
  ___  ____  ____  ____  ____ ®
 /__    /   ____/   /   ____/      18.0
___/   /   /___/   /   /___/       MP—Parallel Edition

 Statistics and Data Science       Copyright 1985-2023 StataCorp LLC
                                   StataCorp
                                   4905 Lakeway Drive
                                   College Station, Texas 77845 USA
                                   800-STATA-PC        https://www.stata.com
                                   979-696-4600        stata@stata.com

Stata license: 22-user 8-core network, expiring 30 Jun 2026
Serial number: 501909306443
  Licensed to: The University of Chicago Booth School of Business
               Mercury Computing Cluster

Notes:
      1. Stata is running in batch mode.
      2. Unicode is supported; see help unicode_advice.
      3. More than 2 billion observations are allowed; see help obs_advice.
      4. Maximum number of variables is set to 5,000 but can be increased;
          see help set_maxvar.

. do "/project/fagoolsb/git/service_industries/replication_package/2_master.do"
>  

. * Author: Joe Tatarka
. * Name: 2_master.do
. * Purpose: Run all of the .do files for the replication package
. * Note: Need to run 1_1_merge_visits_and_spend.ipynb before this
. 
. * Set Global File Paths
. global root = "/project/fagoolsb/service_industries/replication_package"

. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. * Set Paths to raw data outside of replication package
. global homebase_root = "/project/fagoolsb/service_industries/data/datasets/ra
> w/homebase"

. global gws_root = "/project/fagoolsb/generally_useful_datasets/gws_06_17_24_p
> ull/clean"

. 
. * Set Paths to .do files
. *Currently have all of the code in the git folder
. global code_root = "/project/fagoolsb/git/service_industries/replication_pack
> age"

. global code_built_root = "${code_root}/builds"

. global code_exhibits_root = "${code_root}/exhibits"

. 
. *****************************************************************************
> **
. *** Run .do files
. *****************************************************************************
> ***
. **** Cleaning Code
. **** 1. Run 1_2_main_build.do
. **** This cleans the merged SafeGraph Spend and Visits Data to create main_bu
> ild.dta
. do "${code_built_root}/1_main_build/1_2_main_build.do"

. * Author: Joe Tatarka
. * Name: 2_main_build.do
. * Purpose: Take data spend and visits merged data from 1_merge_visits_and_spe
> nd.ipynb and clean to create main_build.dta
. 
. * Set Global File Paths
. *global root = "/project/fagoolsb/service_industries/replication_package"
. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. *****************************************************************************
> ***
. *** Part 1: Load in things to merge 
. *****************************************************************************
> ***
. 
. ************************************
. *** 1.1 Bring in inflation deflators 
. *************************************
. **** Limited-Service Deflators
. tempfile cpi_limited

. import excel "${raw_root}/cpi/limited_cpi_nsa_feb_2025.xlsx", clear firstrow 
> cellrange(A12:D349)
(4 vars, 337 obs)

. 
. rename *, lower

. drop seriesid 

. rename value cpi_limited

. drop if substr(period, 1,1) == "S"
(12 observations deleted)

. 
. replace period = substr(period,2,2)
(325 real changes made)

. destring period, replace 
period: all characters numeric; replaced as byte

. 
. gen year_month_gs = ym(year, period)

. format year_month_gs %tm

. 
. gen base = cpi_limited if year_month_gs == monthly("Jan2019", "MY")
(324 missing values generated)

. egen base_jan_2019 = max(base)

. 
. replace cpi_limited = 100*(cpi_limited/base_jan_2019)
(325 real changes made)

. 
. keep if year_month_gs >= monthly("jan2019", "MY") & year_month_gs <= monthly(
> "dec2022", "MY")
(277 observations deleted)

. 
. keep cpi_limited year_month_gs

. 
. save `cpi_limited', replace
(file /scratch/jtatarka/14755312/St926396.000001 not found)
file /scratch/jtatarka/14755312/St926396.000001 saved as .dta format

. *****************************************************************************
> ***
. **** Part 2: Bring in Main Data and Merge 
. *****************************************************************************
> ***
. **********************************
. **** 2.1 Load in main data and do initial cleaning 
. **********************************
. * import delimited "${intermediate_root}/7225_visits_and_spend_merge", rowran
> ge(1:10000) clear
. import delimited "${intermediate_root}/1_main_build/7225_visits_and_spend_mer
> ge", clear 
(encoding automatically selected: ISO-8859-1)
(51 vars, 34,738,180 obs)

. 
. *drop if no spend
. drop if raw_total_spend == .
(20,551,293 observations deleted)

. 
. *** Keep only 50 states and DC,
. * drop guam, american samoa, virgin islands, and puerto rico 
. tostring poi_cbg, replace format(%17.0g)
poi_cbg was double now str12

. replace poi_cbg = "0" + poi_cbg if strlen(poi_cbg) < 12
(2,960,211 real changes made)

. 
. gen state_fips_code = substr(poi_cbg,1,2)

. 
. drop if state_fips_code == "66" | state_fips_code == "60" | state_fips_code =
> = "78" | state_fips_code == "72"
(382 observations deleted)

. 
. * Keep branded limited service restaurants (so drop both full service and non
> -branded)
. * we do this because branded limited service restaurants have better spend co
> verage
. drop if naics_code == 722511 | brands == ""
(7,923,671 observations deleted)

. 
. compress brands
  variable brands was str44 now str37
  (43,839,838 bytes saved)

. 
. **** Drop any zeroes or wacky negatives (this drops almost entirely observati
> ons with emp == 0)
. rename dwell_240_plus emp 

. rename raw_total_spend nominal_spend

. gen visits = dwell_less_5 + dwell_5_to_10 + dwell_11_to_20 + dwell_21_to_60 +
>  dwell_61_to_120 + dwell_121_to_240

. 
. drop if emp <= 0 
(521,950 observations deleted)

. drop if nominal_spend <= 0
(1 observation deleted)

. drop if visits <= 0
(21,798 observations deleted)

. 
. ***** Drop any POI with only single observation (need multiple obs per POI to
>  use POI fixed effects)
. bys placekey: egen count = count(placekey)

. drop if count == 1
(4,659 observations deleted)

. drop count

. 
. *** Turn year_month_gs variable into a numeric format
. rename year_month_gs year_month_prelim

. gen year_month_gs = monthly(year_month_prelim, "YM")

. format year_month_gs %tm

. label variable year_month_gs "Year-month"

. 
. **********************************
. **** 2.2 Merge in Deflator  
. **********************************
. merge m:1 year_month_gs using `cpi_limited', keep(1 3) nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                         5,714,426  
    -----------------------------------------

. 
. **********************************
. **** 2.3 Rename, clean up, and create variables  
. **********************************
. * Deflate spend
. gen spend = (100/cpi_limited)*nominal_spend 

. 
. *** label variables 
. label var spend "Spend, Jan 2019 $"

. label var nominal_spend "Raw Spend"

. label var emp "Employees"

. label var visits "Visits"

. 
. *** Create productivity measures 
. gen ln_spend_prod = ln(spend/emp)

. label var ln_spend_prod "ln(Spend Productivity)"

. gen ln_visits_prod = ln(visits/emp)

. label var ln_visits_prod "ln(Visits Productivity)"

. gen ln_spend = ln(spend)

. label var ln_spend "ln(Spend)"

. gen ln_emp = ln(emp)

. label var ln_emp "ln(Emp)"

. gen ln_visits = ln(visits)

. label var ln_visits "ln(Visits)"

. 
. * gen avg dwell time 
. * multiply middle of time bucket by share of visits from that bucket
. gen avg_dwell_time = (2.5*dwell_less_5 + 7.5*dwell_5_to_10 + 15*dwell_11_to_2
> 0 + 40*dwell_21_to_60 + 90*dwell_61_to_120 + 180*dwell_121_to_240)/visits

. label var avg_dwell_time "Avg Dwell Time"

. 
. * dwell shares
. gen dwell_0_to_10_share = (dwell_5_to_10 + dwell_less_5)/visits

. label variable dwell_0_to_10_share "0-10 min Share"

. 
. foreach var in "dwell_11_to_20" "dwell_21_to_60" {
  2.         gen `var'_share = `var'/visits
  3. } 

. label var dwell_11_to_20_share "11-20 min Share"

. label var dwell_21_to_60_share "21-60 min Share"

. 
. gen dwell_61_to_240_share = (dwell_61_to_120 + dwell_121_to_240)/visits

. label var dwell_61_to_240_share "61-240 min Share"

. 
. order placekey year_month_gs naics_code spend emp visits, first

. 
. **** Only keep important variables for replication 
. keep placekey year_month_gs naics_code spend emp visits nominal_spend ln_spen
> d ln_emp ln_visits ln_spend_prod ln_visits_prod avg_dwell_time dwell_0_to_10_
> share dwell_11_to_20_share dwell_21_to_60_share dwell_61_to_240_share brands

. 
. sort placekey year_month_gs

. 
. **********************************
. **** 2.4 Save the dataset 
. **********************************
. save "${built_root}/main_build.dta", replace
file
    /project/fagoolsb/service_industries/replication_package/datasets/built/m
    > ain_build.dta saved

. 
end of do-file

. 
. **** 2. Run 2_1_aggregates_build.do
. **** Merge SafeGraph data with Census Retail Sales to create aggregates_build
> .dta
. do "${code_built_root}/2_aggregates_build/2_1_aggregates_build.do"

. * Author: Joe Tatarka
. * Name: 2_1_aggregates_build.do
. * Purpose: Create aggregate dataset to create figures for the paper. Bring in
>  Census and BLS aggregate sales and employees and CPI deflators. Also bring i
> n aggregates from our SafeGraph sample. Creates aggregates_build.dta
. 
. * Set Global File Paths
. *global root = "/project/fagoolsb/service_industries/replication_package"
. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. * set more off so 
. set more off 

. 
. ***********************************************************************
. ***** 1. Bring in Inflation Indexes
. ***************************************************************************
. *** Bring in inflation deflators 
. 
. ************************************
. **** Limited-Service Deflators (NSA)
. tempfile cpi_limited

. import excel "${raw_root}/cpi/limited_cpi_nsa_feb_2025.xlsx", clear firstrow 
> cellrange(A12:D349)
(4 vars, 337 obs)

. 
. rename *, lower

. drop seriesid 

. rename value cpi_limited

. drop if substr(period, 1,1) == "S"
(12 observations deleted)

. 
. replace period = substr(period,2,2)
(325 real changes made)

. destring period, replace 
period: all characters numeric; replaced as byte

. 
. gen year_month_gs = ym(year, period)

. format year_month_gs %tm

. 
. gen base = cpi_limited if year_month_gs == monthly("Jan2019", "MY")
(324 missing values generated)

. egen base_jan_2019 = max(base)

. 
. replace cpi_limited = 100*(cpi_limited/base_jan_2019)
(325 real changes made)

. 
. keep cpi_limited year_month_gs

. 
. save `cpi_limited', replace
(file /scratch/jtatarka/14755312/St926396.000001 not found)
file /scratch/jtatarka/14755312/St926396.000001 saved as .dta format

. 
. *************************************
. *** Food Away from Home deflator (NSA)
. tempfile cpi_food_nsa 

. 
. import excel "${raw_root}/cpi/food_away_cpi_nsa_feb_2025.xlsx", clear firstro
> w cellrange(A12:D472)
(4 vars, 460 obs)

. 
. rename *, lower

. drop seriesid 

. rename value cpi_food

. drop if substr(period, 1,1) == "S"
(64 observations deleted)

. 
. replace period = substr(period,2,2)
(396 real changes made)

. destring period, replace 
period: all characters numeric; replaced as byte

. 
. gen year_month_gs = ym(year, period)

. format year_month_gs %tm

. 
. gen double base = cpi_food if year_month_gs == monthly("Jan2019", "MY")
(395 missing values generated)

. egen double base_jan_2019 = max(base)

. 
. replace cpi_food = 100*(cpi_food/base_jan_2019)
(396 real changes made)

. 
. keep cpi_food year_month_gs

. rename cpi_food cpi_food_nsa

. 
. save `cpi_food_nsa', replace
(file /scratch/jtatarka/14755312/St926396.000002 not found)
file /scratch/jtatarka/14755312/St926396.000002 saved as .dta format

. 
. ***************************************
. *** Food Away from Home deflator (SA)
. tempfile cpi_food_sa 

. 
. import excel "${raw_root}/cpi/food_away_cpi_sa_feb_2025.xlsx", clear firstrow
>  cellrange(A12:D407)
(4 vars, 395 obs)

. 
. rename *, lower

. drop seriesid 

. rename value cpi_food

. drop if substr(period, 1,1) == "S"
(0 observations deleted)

. 
. replace period = substr(period,2,2)
(395 real changes made)

. destring period, replace 
period: all characters numeric; replaced as byte

. 
. gen year_month_gs = ym(year, period)

. format year_month_gs %tm

. 
. gen double base = cpi_food if year_month_gs == monthly("Jan2019", "MY")
(394 missing values generated)

. egen double base_jan_2019 = max(base)

. 
. replace cpi_food = 100*(cpi_food/base_jan_2019)
(395 real changes made)

. 
. keep cpi_food year_month_gs

. rename cpi_food cpi_food_sa

. 
. save `cpi_food_sa', replace
(file /scratch/jtatarka/14755312/St926396.000003 not found)
file /scratch/jtatarka/14755312/St926396.000003 saved as .dta format

. 
. 
. *** combine deflators
. tempfile deflators

. merge 1:1 year_month_gs using `cpi_limited', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                            72
        from master                        71  
        from using                          1  

    Matched                               324  
    -----------------------------------------

. merge 1:1 year_month_gs using `cpi_food_nsa', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                               396  
    -----------------------------------------

. save `deflators', replace
(file /scratch/jtatarka/14755312/St926396.000004 not found)
file /scratch/jtatarka/14755312/St926396.000004 saved as .dta format

. 
. 
. ***********************************************
. **** 2. Prepare Safegraph Aggregates
. ***********************************************
. * We want monthly aggregates of spend, emp, and visits for our main_build sam
> ple.
. use placekey year_month_gs spend nominal_spend visits emp using "${built_root
> }/main_build.dta", clear

. rename spend spend_sg

. rename visits visits_sg 

. rename emp emp_sg

. rename nominal_spend nominal_spend_sg

. tempfile sg

. collapse (sum) spend_sg visits_sg emp_sg nominal_spend_sg, by(year_month_gs)

. 
. save `sg', replace
(file /scratch/jtatarka/14755312/St926396.000005 not found)
file /scratch/jtatarka/14755312/St926396.000005 saved as .dta format

. 
. *****************************************************************************
> ***
. ******* 3. Bring in Census Monthly Retail Sales data
. *****************************************************************************
> ***
. ******* Census monthly sales 
. 
. forval yr = 1992/2023 {
  2.         
.         tempfile census_`yr'
  3.         import excel "${raw_root}/census_monthly_retail_trade/mrtssales92-
> present_feb_2025.xlsx", clear firstrow sheet("`yr'") cellrange(B5:O110)
  4.         replace B = "food_nsa" if _n == 62
  5.         replace B = "limited" if _n == 66
  6.         replace B = "food_sa" if _n == 105
  7.         keep if _n == 62 | _n == 66 | _n == 105
  8.         drop TOTAL
  9.         
.         foreach var of varlist _all {
 10.                 rename `var' sales_prelim`var'
 11.         }
 12.         
.         rename sales_prelimB rest_type
 13. destring sales_prelimJan`yr'-sales_prelimDec`yr', replace
 14. reshape long sales_prelim, i(rest_type) j(year_month_prelim) string
 15. 
. destring sales_prelim, replace
 16. gen year_month_gs = monthly(year_month_prelim, "MY")
 17. format year_month_gs %tm
 18. drop year_month_prelim
 19. reshape wide sales_prelim, i(year_month_gs) j(rest_type) string
 20. reshape long
 21. replace sales_prelim = (sales_prelim*1000000)
 22. format sales_prelim %15.0g
 23. rename sales_prelim spend_
 24. 
. reshape wide spend_, i(year_month_gs) j(rest_type) string
 25.         
.         save `census_`yr'', replace
 26. }
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1992: all characters numeric; replaced as int
sales_prelimFeb1992: all characters numeric; replaced as int
sales_prelimMar1992: all characters numeric; replaced as int
sales_prelimApr1992: all characters numeric; replaced as int
sales_prelimMay1992: all characters numeric; replaced as int
sales_prelimJun1992: all characters numeric; replaced as int
sales_prelimJul1992: all characters numeric; replaced as int
sales_prelimAug1992: all characters numeric; replaced as int
sales_prelimSep1992: all characters numeric; replaced as int
sales_prelimOct1992: all characters numeric; replaced as int
sales_prelimNov1992: all characters numeric; replaced as int
sales_prelimDec1992: all characters numeric; replaced as int
(j = Apr1992 Aug1992 Dec1992 Feb1992 Jan1992 Jul1992 Jun1992 Mar1992 May1992 No
> v1992 Oct1992 Sep1992)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1992 sales_prelimAug1992 ... sales_prelimSep1992->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000006 not found)
file /scratch/jtatarka/14755312/St926396.000006 saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1993: all characters numeric; replaced as int
sales_prelimFeb1993: all characters numeric; replaced as int
sales_prelimMar1993: all characters numeric; replaced as int
sales_prelimApr1993: all characters numeric; replaced as int
sales_prelimMay1993: all characters numeric; replaced as int
sales_prelimJun1993: all characters numeric; replaced as int
sales_prelimJul1993: all characters numeric; replaced as int
sales_prelimAug1993: all characters numeric; replaced as int
sales_prelimSep1993: all characters numeric; replaced as int
sales_prelimOct1993: all characters numeric; replaced as int
sales_prelimNov1993: all characters numeric; replaced as int
sales_prelimDec1993: all characters numeric; replaced as int
(j = Apr1993 Aug1993 Dec1993 Feb1993 Jan1993 Jul1993 Jun1993 Mar1993 May1993 No
> v1993 Oct1993 Sep1993)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1993 sales_prelimAug1993 ... sales_prelimSep1993->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000007 not found)
file /scratch/jtatarka/14755312/St926396.000007 saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1994: all characters numeric; replaced as int
sales_prelimFeb1994: all characters numeric; replaced as int
sales_prelimMar1994: all characters numeric; replaced as int
sales_prelimApr1994: all characters numeric; replaced as int
sales_prelimMay1994: all characters numeric; replaced as int
sales_prelimJun1994: all characters numeric; replaced as int
sales_prelimJul1994: all characters numeric; replaced as int
sales_prelimAug1994: all characters numeric; replaced as int
sales_prelimSep1994: all characters numeric; replaced as int
sales_prelimOct1994: all characters numeric; replaced as int
sales_prelimNov1994: all characters numeric; replaced as int
sales_prelimDec1994: all characters numeric; replaced as int
(j = Apr1994 Aug1994 Dec1994 Feb1994 Jan1994 Jul1994 Jun1994 Mar1994 May1994 No
> v1994 Oct1994 Sep1994)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1994 sales_prelimAug1994 ... sales_prelimSep1994->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000008 not found)
file /scratch/jtatarka/14755312/St926396.000008 saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1995: all characters numeric; replaced as int
sales_prelimFeb1995: all characters numeric; replaced as int
sales_prelimMar1995: all characters numeric; replaced as int
sales_prelimApr1995: all characters numeric; replaced as int
sales_prelimMay1995: all characters numeric; replaced as int
sales_prelimJun1995: all characters numeric; replaced as int
sales_prelimJul1995: all characters numeric; replaced as int
sales_prelimAug1995: all characters numeric; replaced as int
sales_prelimSep1995: all characters numeric; replaced as int
sales_prelimOct1995: all characters numeric; replaced as int
sales_prelimNov1995: all characters numeric; replaced as int
sales_prelimDec1995: all characters numeric; replaced as int
(j = Apr1995 Aug1995 Dec1995 Feb1995 Jan1995 Jul1995 Jun1995 Mar1995 May1995 No
> v1995 Oct1995 Sep1995)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1995 sales_prelimAug1995 ... sales_prelimSep1995->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000009 not found)
file /scratch/jtatarka/14755312/St926396.000009 saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1996: all characters numeric; replaced as int
sales_prelimFeb1996: all characters numeric; replaced as int
sales_prelimMar1996: all characters numeric; replaced as int
sales_prelimApr1996: all characters numeric; replaced as int
sales_prelimMay1996: all characters numeric; replaced as int
sales_prelimJun1996: all characters numeric; replaced as int
sales_prelimJul1996: all characters numeric; replaced as int
sales_prelimAug1996: all characters numeric; replaced as int
sales_prelimSep1996: all characters numeric; replaced as int
sales_prelimOct1996: all characters numeric; replaced as int
sales_prelimNov1996: all characters numeric; replaced as int
sales_prelimDec1996: all characters numeric; replaced as int
(j = Apr1996 Aug1996 Dec1996 Feb1996 Jan1996 Jul1996 Jun1996 Mar1996 May1996 No
> v1996 Oct1996 Sep1996)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1996 sales_prelimAug1996 ... sales_prelimSep1996->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000a not found)
file /scratch/jtatarka/14755312/St926396.00000a saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1997: all characters numeric; replaced as int
sales_prelimFeb1997: all characters numeric; replaced as int
sales_prelimMar1997: all characters numeric; replaced as int
sales_prelimApr1997: all characters numeric; replaced as int
sales_prelimMay1997: all characters numeric; replaced as int
sales_prelimJun1997: all characters numeric; replaced as int
sales_prelimJul1997: all characters numeric; replaced as int
sales_prelimAug1997: all characters numeric; replaced as int
sales_prelimSep1997: all characters numeric; replaced as int
sales_prelimOct1997: all characters numeric; replaced as int
sales_prelimNov1997: all characters numeric; replaced as int
sales_prelimDec1997: all characters numeric; replaced as int
(j = Apr1997 Aug1997 Dec1997 Feb1997 Jan1997 Jul1997 Jun1997 Mar1997 May1997 No
> v1997 Oct1997 Sep1997)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1997 sales_prelimAug1997 ... sales_prelimSep1997->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000b not found)
file /scratch/jtatarka/14755312/St926396.00000b saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1998: all characters numeric; replaced as int
sales_prelimFeb1998: all characters numeric; replaced as int
sales_prelimMar1998: all characters numeric; replaced as int
sales_prelimApr1998: all characters numeric; replaced as int
sales_prelimMay1998: all characters numeric; replaced as int
sales_prelimJun1998: all characters numeric; replaced as int
sales_prelimJul1998: all characters numeric; replaced as int
sales_prelimAug1998: all characters numeric; replaced as int
sales_prelimSep1998: all characters numeric; replaced as int
sales_prelimOct1998: all characters numeric; replaced as int
sales_prelimNov1998: all characters numeric; replaced as int
sales_prelimDec1998: all characters numeric; replaced as int
(j = Apr1998 Aug1998 Dec1998 Feb1998 Jan1998 Jul1998 Jun1998 Mar1998 May1998 No
> v1998 Oct1998 Sep1998)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1998 sales_prelimAug1998 ... sales_prelimSep1998->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000c not found)
file /scratch/jtatarka/14755312/St926396.00000c saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan1999: all characters numeric; replaced as int
sales_prelimFeb1999: all characters numeric; replaced as int
sales_prelimMar1999: all characters numeric; replaced as int
sales_prelimApr1999: all characters numeric; replaced as int
sales_prelimMay1999: all characters numeric; replaced as int
sales_prelimJun1999: all characters numeric; replaced as int
sales_prelimJul1999: all characters numeric; replaced as int
sales_prelimAug1999: all characters numeric; replaced as int
sales_prelimSep1999: all characters numeric; replaced as int
sales_prelimOct1999: all characters numeric; replaced as int
sales_prelimNov1999: all characters numeric; replaced as int
sales_prelimDec1999: all characters numeric; replaced as int
(j = Apr1999 Aug1999 Dec1999 Feb1999 Jan1999 Jul1999 Jun1999 Mar1999 May1999 No
> v1999 Oct1999 Sep1999)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr1999 sales_prelimAug1999 ... sales_prelimSep1999->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000d not found)
file /scratch/jtatarka/14755312/St926396.00000d saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2000: all characters numeric; replaced as int
sales_prelimFeb2000: all characters numeric; replaced as int
sales_prelimMar2000: all characters numeric; replaced as int
sales_prelimApr2000: all characters numeric; replaced as int
sales_prelimMay2000: all characters numeric; replaced as int
sales_prelimJun2000: all characters numeric; replaced as int
sales_prelimJul2000: all characters numeric; replaced as int
sales_prelimAug2000: all characters numeric; replaced as int
sales_prelimSep2000: all characters numeric; replaced as int
sales_prelimOct2000: all characters numeric; replaced as int
sales_prelimNov2000: all characters numeric; replaced as int
sales_prelimDec2000: all characters numeric; replaced as int
(j = Apr2000 Aug2000 Dec2000 Feb2000 Jan2000 Jul2000 Jun2000 Mar2000 May2000 No
> v2000 Oct2000 Sep2000)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2000 sales_prelimAug2000 ... sales_prelimSep2000->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was int now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000e not found)
file /scratch/jtatarka/14755312/St926396.00000e saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2001 already numeric; no replace
sales_prelimFeb2001 already numeric; no replace
sales_prelimMar2001 already numeric; no replace
sales_prelimApr2001 already numeric; no replace
sales_prelimMay2001 already numeric; no replace
sales_prelimJun2001 already numeric; no replace
sales_prelimJul2001 already numeric; no replace
sales_prelimAug2001 already numeric; no replace
sales_prelimSep2001 already numeric; no replace
sales_prelimOct2001 already numeric; no replace
sales_prelimNov2001 already numeric; no replace
sales_prelimDec2001 already numeric; no replace
(j = Apr2001 Aug2001 Dec2001 Feb2001 Jan2001 Jul2001 Jun2001 Mar2001 May2001 No
> v2001 Oct2001 Sep2001)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2001 sales_prelimAug2001 ... sales_prelimSep2001->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000f not found)
file /scratch/jtatarka/14755312/St926396.00000f saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2002 already numeric; no replace
sales_prelimFeb2002 already numeric; no replace
sales_prelimMar2002 already numeric; no replace
sales_prelimApr2002 already numeric; no replace
sales_prelimMay2002 already numeric; no replace
sales_prelimJun2002 already numeric; no replace
sales_prelimJul2002 already numeric; no replace
sales_prelimAug2002 already numeric; no replace
sales_prelimSep2002 already numeric; no replace
sales_prelimOct2002 already numeric; no replace
sales_prelimNov2002 already numeric; no replace
sales_prelimDec2002 already numeric; no replace
(j = Apr2002 Aug2002 Dec2002 Feb2002 Jan2002 Jul2002 Jun2002 Mar2002 May2002 No
> v2002 Oct2002 Sep2002)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2002 sales_prelimAug2002 ... sales_prelimSep2002->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000g not found)
file /scratch/jtatarka/14755312/St926396.00000g saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2003 already numeric; no replace
sales_prelimFeb2003 already numeric; no replace
sales_prelimMar2003 already numeric; no replace
sales_prelimApr2003 already numeric; no replace
sales_prelimMay2003 already numeric; no replace
sales_prelimJun2003 already numeric; no replace
sales_prelimJul2003 already numeric; no replace
sales_prelimAug2003 already numeric; no replace
sales_prelimSep2003 already numeric; no replace
sales_prelimOct2003 already numeric; no replace
sales_prelimNov2003 already numeric; no replace
sales_prelimDec2003 already numeric; no replace
(j = Apr2003 Aug2003 Dec2003 Feb2003 Jan2003 Jul2003 Jun2003 Mar2003 May2003 No
> v2003 Oct2003 Sep2003)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2003 sales_prelimAug2003 ... sales_prelimSep2003->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000h not found)
file /scratch/jtatarka/14755312/St926396.00000h saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2004 already numeric; no replace
sales_prelimFeb2004 already numeric; no replace
sales_prelimMar2004 already numeric; no replace
sales_prelimApr2004 already numeric; no replace
sales_prelimMay2004 already numeric; no replace
sales_prelimJun2004 already numeric; no replace
sales_prelimJul2004 already numeric; no replace
sales_prelimAug2004 already numeric; no replace
sales_prelimSep2004 already numeric; no replace
sales_prelimOct2004 already numeric; no replace
sales_prelimNov2004 already numeric; no replace
sales_prelimDec2004 already numeric; no replace
(j = Apr2004 Aug2004 Dec2004 Feb2004 Jan2004 Jul2004 Jun2004 Mar2004 May2004 No
> v2004 Oct2004 Sep2004)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2004 sales_prelimAug2004 ... sales_prelimSep2004->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000i not found)
file /scratch/jtatarka/14755312/St926396.00000i saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2005 already numeric; no replace
sales_prelimFeb2005 already numeric; no replace
sales_prelimMar2005 already numeric; no replace
sales_prelimApr2005 already numeric; no replace
sales_prelimMay2005 already numeric; no replace
sales_prelimJun2005 already numeric; no replace
sales_prelimJul2005 already numeric; no replace
sales_prelimAug2005 already numeric; no replace
sales_prelimSep2005 already numeric; no replace
sales_prelimOct2005 already numeric; no replace
sales_prelimNov2005 already numeric; no replace
sales_prelimDec2005 already numeric; no replace
(j = Apr2005 Aug2005 Dec2005 Feb2005 Jan2005 Jul2005 Jun2005 Mar2005 May2005 No
> v2005 Oct2005 Sep2005)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2005 sales_prelimAug2005 ... sales_prelimSep2005->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000j not found)
file /scratch/jtatarka/14755312/St926396.00000j saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2006 already numeric; no replace
sales_prelimFeb2006 already numeric; no replace
sales_prelimMar2006 already numeric; no replace
sales_prelimApr2006 already numeric; no replace
sales_prelimMay2006 already numeric; no replace
sales_prelimJun2006 already numeric; no replace
sales_prelimJul2006 already numeric; no replace
sales_prelimAug2006 already numeric; no replace
sales_prelimSep2006 already numeric; no replace
sales_prelimOct2006 already numeric; no replace
sales_prelimNov2006 already numeric; no replace
sales_prelimDec2006 already numeric; no replace
(j = Apr2006 Aug2006 Dec2006 Feb2006 Jan2006 Jul2006 Jun2006 Mar2006 May2006 No
> v2006 Oct2006 Sep2006)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2006 sales_prelimAug2006 ... sales_prelimSep2006->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000k not found)
file /scratch/jtatarka/14755312/St926396.00000k saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2007 already numeric; no replace
sales_prelimFeb2007 already numeric; no replace
sales_prelimMar2007 already numeric; no replace
sales_prelimApr2007 already numeric; no replace
sales_prelimMay2007 already numeric; no replace
sales_prelimJun2007 already numeric; no replace
sales_prelimJul2007 already numeric; no replace
sales_prelimAug2007 already numeric; no replace
sales_prelimSep2007 already numeric; no replace
sales_prelimOct2007 already numeric; no replace
sales_prelimNov2007 already numeric; no replace
sales_prelimDec2007 already numeric; no replace
(j = Apr2007 Aug2007 Dec2007 Feb2007 Jan2007 Jul2007 Jun2007 Mar2007 May2007 No
> v2007 Oct2007 Sep2007)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2007 sales_prelimAug2007 ... sales_prelimSep2007->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000l not found)
file /scratch/jtatarka/14755312/St926396.00000l saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2008 already numeric; no replace
sales_prelimFeb2008 already numeric; no replace
sales_prelimMar2008 already numeric; no replace
sales_prelimApr2008 already numeric; no replace
sales_prelimMay2008 already numeric; no replace
sales_prelimJun2008 already numeric; no replace
sales_prelimJul2008 already numeric; no replace
sales_prelimAug2008 already numeric; no replace
sales_prelimSep2008 already numeric; no replace
sales_prelimOct2008 already numeric; no replace
sales_prelimNov2008 already numeric; no replace
sales_prelimDec2008 already numeric; no replace
(j = Apr2008 Aug2008 Dec2008 Feb2008 Jan2008 Jul2008 Jun2008 Mar2008 May2008 No
> v2008 Oct2008 Sep2008)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2008 sales_prelimAug2008 ... sales_prelimSep2008->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000m not found)
file /scratch/jtatarka/14755312/St926396.00000m saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2009 already numeric; no replace
sales_prelimFeb2009 already numeric; no replace
sales_prelimMar2009 already numeric; no replace
sales_prelimApr2009 already numeric; no replace
sales_prelimMay2009 already numeric; no replace
sales_prelimJun2009 already numeric; no replace
sales_prelimJul2009 already numeric; no replace
sales_prelimAug2009 already numeric; no replace
sales_prelimSep2009 already numeric; no replace
sales_prelimOct2009 already numeric; no replace
sales_prelimNov2009 already numeric; no replace
sales_prelimDec2009 already numeric; no replace
(j = Apr2009 Aug2009 Dec2009 Feb2009 Jan2009 Jul2009 Jun2009 Mar2009 May2009 No
> v2009 Oct2009 Sep2009)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2009 sales_prelimAug2009 ... sales_prelimSep2009->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000n not found)
file /scratch/jtatarka/14755312/St926396.00000n saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2010 already numeric; no replace
sales_prelimFeb2010 already numeric; no replace
sales_prelimMar2010 already numeric; no replace
sales_prelimApr2010 already numeric; no replace
sales_prelimMay2010 already numeric; no replace
sales_prelimJun2010 already numeric; no replace
sales_prelimJul2010 already numeric; no replace
sales_prelimAug2010 already numeric; no replace
sales_prelimSep2010 already numeric; no replace
sales_prelimOct2010 already numeric; no replace
sales_prelimNov2010 already numeric; no replace
sales_prelimDec2010 already numeric; no replace
(j = Apr2010 Aug2010 Dec2010 Feb2010 Jan2010 Jul2010 Jun2010 Mar2010 May2010 No
> v2010 Oct2010 Sep2010)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2010 sales_prelimAug2010 ... sales_prelimSep2010->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000o not found)
file /scratch/jtatarka/14755312/St926396.00000o saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2011 already numeric; no replace
sales_prelimFeb2011 already numeric; no replace
sales_prelimMar2011 already numeric; no replace
sales_prelimApr2011 already numeric; no replace
sales_prelimMay2011 already numeric; no replace
sales_prelimJun2011 already numeric; no replace
sales_prelimJul2011 already numeric; no replace
sales_prelimAug2011 already numeric; no replace
sales_prelimSep2011 already numeric; no replace
sales_prelimOct2011 already numeric; no replace
sales_prelimNov2011 already numeric; no replace
sales_prelimDec2011 already numeric; no replace
(j = Apr2011 Aug2011 Dec2011 Feb2011 Jan2011 Jul2011 Jun2011 Mar2011 May2011 No
> v2011 Oct2011 Sep2011)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2011 sales_prelimAug2011 ... sales_prelimSep2011->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000p not found)
file /scratch/jtatarka/14755312/St926396.00000p saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2012 already numeric; no replace
sales_prelimFeb2012 already numeric; no replace
sales_prelimMar2012 already numeric; no replace
sales_prelimApr2012 already numeric; no replace
sales_prelimMay2012 already numeric; no replace
sales_prelimJun2012 already numeric; no replace
sales_prelimJul2012 already numeric; no replace
sales_prelimAug2012 already numeric; no replace
sales_prelimSep2012 already numeric; no replace
sales_prelimOct2012 already numeric; no replace
sales_prelimNov2012 already numeric; no replace
sales_prelimDec2012 already numeric; no replace
(j = Apr2012 Aug2012 Dec2012 Feb2012 Jan2012 Jul2012 Jun2012 Mar2012 May2012 No
> v2012 Oct2012 Sep2012)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2012 sales_prelimAug2012 ... sales_prelimSep2012->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000q not found)
file /scratch/jtatarka/14755312/St926396.00000q saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2013 already numeric; no replace
sales_prelimFeb2013 already numeric; no replace
sales_prelimMar2013 already numeric; no replace
sales_prelimApr2013 already numeric; no replace
sales_prelimMay2013 already numeric; no replace
sales_prelimJun2013 already numeric; no replace
sales_prelimJul2013 already numeric; no replace
sales_prelimAug2013 already numeric; no replace
sales_prelimSep2013 already numeric; no replace
sales_prelimOct2013 already numeric; no replace
sales_prelimNov2013 already numeric; no replace
sales_prelimDec2013 already numeric; no replace
(j = Apr2013 Aug2013 Dec2013 Feb2013 Jan2013 Jul2013 Jun2013 Mar2013 May2013 No
> v2013 Oct2013 Sep2013)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2013 sales_prelimAug2013 ... sales_prelimSep2013->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000r not found)
file /scratch/jtatarka/14755312/St926396.00000r saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2014 already numeric; no replace
sales_prelimFeb2014 already numeric; no replace
sales_prelimMar2014 already numeric; no replace
sales_prelimApr2014 already numeric; no replace
sales_prelimMay2014 already numeric; no replace
sales_prelimJun2014 already numeric; no replace
sales_prelimJul2014 already numeric; no replace
sales_prelimAug2014 already numeric; no replace
sales_prelimSep2014 already numeric; no replace
sales_prelimOct2014 already numeric; no replace
sales_prelimNov2014 already numeric; no replace
sales_prelimDec2014 already numeric; no replace
(j = Apr2014 Aug2014 Dec2014 Feb2014 Jan2014 Jul2014 Jun2014 Mar2014 May2014 No
> v2014 Oct2014 Sep2014)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2014 sales_prelimAug2014 ... sales_prelimSep2014->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000s not found)
file /scratch/jtatarka/14755312/St926396.00000s saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2015 already numeric; no replace
sales_prelimFeb2015 already numeric; no replace
sales_prelimMar2015 already numeric; no replace
sales_prelimApr2015 already numeric; no replace
sales_prelimMay2015 already numeric; no replace
sales_prelimJun2015 already numeric; no replace
sales_prelimJul2015 already numeric; no replace
sales_prelimAug2015 already numeric; no replace
sales_prelimSep2015 already numeric; no replace
sales_prelimOct2015 already numeric; no replace
sales_prelimNov2015 already numeric; no replace
sales_prelimDec2015 already numeric; no replace
(j = Apr2015 Aug2015 Dec2015 Feb2015 Jan2015 Jul2015 Jun2015 Mar2015 May2015 No
> v2015 Oct2015 Sep2015)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2015 sales_prelimAug2015 ... sales_prelimSep2015->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000t not found)
file /scratch/jtatarka/14755312/St926396.00000t saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2016 already numeric; no replace
sales_prelimFeb2016 already numeric; no replace
sales_prelimMar2016 already numeric; no replace
sales_prelimApr2016 already numeric; no replace
sales_prelimMay2016 already numeric; no replace
sales_prelimJun2016 already numeric; no replace
sales_prelimJul2016 already numeric; no replace
sales_prelimAug2016 already numeric; no replace
sales_prelimSep2016 already numeric; no replace
sales_prelimOct2016 already numeric; no replace
sales_prelimNov2016 already numeric; no replace
sales_prelimDec2016 already numeric; no replace
(j = Apr2016 Aug2016 Dec2016 Feb2016 Jan2016 Jul2016 Jun2016 Mar2016 May2016 No
> v2016 Oct2016 Sep2016)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2016 sales_prelimAug2016 ... sales_prelimSep2016->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000u not found)
file /scratch/jtatarka/14755312/St926396.00000u saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2017 already numeric; no replace
sales_prelimFeb2017 already numeric; no replace
sales_prelimMar2017: all characters numeric; replaced as long
sales_prelimApr2017: all characters numeric; replaced as long
sales_prelimMay2017: all characters numeric; replaced as long
sales_prelimJun2017: all characters numeric; replaced as long
sales_prelimJul2017: all characters numeric; replaced as long
sales_prelimAug2017: all characters numeric; replaced as long
sales_prelimSep2017: all characters numeric; replaced as long
sales_prelimOct2017: all characters numeric; replaced as long
sales_prelimNov2017: all characters numeric; replaced as long
sales_prelimDec2017: all characters numeric; replaced as long
(j = Apr2017 Aug2017 Dec2017 Feb2017 Jan2017 Jul2017 Jun2017 Mar2017 May2017 No
> v2017 Oct2017 Sep2017)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2017 sales_prelimAug2017 ... sales_prelimSep2017->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000v not found)
file /scratch/jtatarka/14755312/St926396.00000v saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2018: all characters numeric; replaced as long
sales_prelimFeb2018: all characters numeric; replaced as long
sales_prelimMar2018: all characters numeric; replaced as long
sales_prelimApr2018: all characters numeric; replaced as long
sales_prelimMay2018: all characters numeric; replaced as long
sales_prelimJun2018: all characters numeric; replaced as long
sales_prelimJul2018: all characters numeric; replaced as long
sales_prelimAug2018: all characters numeric; replaced as long
sales_prelimSep2018: all characters numeric; replaced as long
sales_prelimOct2018: all characters numeric; replaced as long
sales_prelimNov2018: all characters numeric; replaced as long
sales_prelimDec2018: all characters numeric; replaced as long
(j = Apr2018 Aug2018 Dec2018 Feb2018 Jan2018 Jul2018 Jun2018 Mar2018 May2018 No
> v2018 Oct2018 Sep2018)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2018 sales_prelimAug2018 ... sales_prelimSep2018->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000w not found)
file /scratch/jtatarka/14755312/St926396.00000w saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2019: all characters numeric; replaced as long
sales_prelimFeb2019: all characters numeric; replaced as long
sales_prelimMar2019: all characters numeric; replaced as long
sales_prelimApr2019: all characters numeric; replaced as long
sales_prelimMay2019: all characters numeric; replaced as long
sales_prelimJun2019: all characters numeric; replaced as long
sales_prelimJul2019: all characters numeric; replaced as long
sales_prelimAug2019: all characters numeric; replaced as long
sales_prelimSep2019: all characters numeric; replaced as long
sales_prelimOct2019: all characters numeric; replaced as long
sales_prelimNov2019: all characters numeric; replaced as long
sales_prelimDec2019: all characters numeric; replaced as long
(j = Apr2019 Aug2019 Dec2019 Feb2019 Jan2019 Jul2019 Jun2019 Mar2019 May2019 No
> v2019 Oct2019 Sep2019)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2019 sales_prelimAug2019 ... sales_prelimSep2019->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.00000x not found)
file /scratch/jtatarka/14755312/St926396.00000x saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2020: all characters numeric; replaced as long
sales_prelimFeb2020: all characters numeric; replaced as long
sales_prelimMar2020: all characters numeric; replaced as long
sales_prelimApr2020: all characters numeric; replaced as int
sales_prelimMay2020: all characters numeric; replaced as long
sales_prelimJun2020: all characters numeric; replaced as long
sales_prelimJul2020: all characters numeric; replaced as long
sales_prelimAug2020: all characters numeric; replaced as long
sales_prelimSep2020: all characters numeric; replaced as long
sales_prelimOct2020: all characters numeric; replaced as long
sales_prelimNov2020: all characters numeric; replaced as long
sales_prelimDec2020: all characters numeric; replaced as long
(j = Apr2020 Aug2020 Dec2020 Feb2020 Jan2020 Jul2020 Jun2020 Mar2020 May2020 No
> v2020 Oct2020 Sep2020)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2020 sales_prelimAug2020 ... sales_prelimSep2020->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000010 not found)
file /scratch/jtatarka/14755312/St926396.000010 saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2021: all characters numeric; replaced as long
sales_prelimFeb2021: all characters numeric; replaced as long
sales_prelimMar2021: all characters numeric; replaced as long
sales_prelimApr2021: all characters numeric; replaced as long
sales_prelimMay2021: all characters numeric; replaced as long
sales_prelimJun2021: all characters numeric; replaced as long
sales_prelimJul2021: all characters numeric; replaced as long
sales_prelimAug2021: all characters numeric; replaced as long
sales_prelimSep2021: all characters numeric; replaced as long
sales_prelimOct2021: all characters numeric; replaced as long
sales_prelimNov2021: all characters numeric; replaced as long
sales_prelimDec2021: all characters numeric; replaced as long
(j = Apr2021 Aug2021 Dec2021 Feb2021 Jan2021 Jul2021 Jun2021 Mar2021 May2021 No
> v2021 Oct2021 Sep2021)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2021 sales_prelimAug2021 ... sales_prelimSep2021->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000011 not found)
file /scratch/jtatarka/14755312/St926396.000011 saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2022: all characters numeric; replaced as long
sales_prelimFeb2022: all characters numeric; replaced as long
sales_prelimMar2022: all characters numeric; replaced as long
sales_prelimApr2022: all characters numeric; replaced as long
sales_prelimMay2022: all characters numeric; replaced as long
sales_prelimJun2022: all characters numeric; replaced as long
sales_prelimJul2022: all characters numeric; replaced as long
sales_prelimAug2022: all characters numeric; replaced as long
sales_prelimSep2022: all characters numeric; replaced as long
sales_prelimOct2022: all characters numeric; replaced as long
sales_prelimNov2022: all characters numeric; replaced as long
sales_prelimDec2022: all characters numeric; replaced as long
(j = Apr2022 Aug2022 Dec2022 Feb2022 Jan2022 Jul2022 Jun2022 Mar2022 May2022 No
> v2022 Oct2022 Sep2022)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2022 sales_prelimAug2022 ... sales_prelimSep2022->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000012 not found)
file /scratch/jtatarka/14755312/St926396.000012 saved as .dta format
(14 vars, 105 obs)
(1 real change made)
(1 real change made)
(1 real change made)
(102 observations deleted)
sales_prelimJan2023: all characters numeric; replaced as long
sales_prelimFeb2023: all characters numeric; replaced as long
sales_prelimMar2023: all characters numeric; replaced as long
sales_prelimApr2023: all characters numeric; replaced as long
sales_prelimMay2023: all characters numeric; replaced as long
sales_prelimJun2023: all characters numeric; replaced as long
sales_prelimJul2023: all characters numeric; replaced as long
sales_prelimAug2023: all characters numeric; replaced as long
sales_prelimSep2023: all characters numeric; replaced as long
sales_prelimOct2023: all characters numeric; replaced as long
sales_prelimNov2023: all characters numeric; replaced as long
sales_prelimDec2023: all characters numeric; replaced as long
(j = Apr2023 Aug2023 Dec2023 Feb2023 Jan2023 Jul2023 Jun2023 Mar2023 May2023 No
> v2023 Oct2023 Sep2023)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   36          
Number of variables                  13   ->   3           
j variable (12 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2023 sales_prelimAug2023 ... sales_prelimSep2023->sales_prelim
-----------------------------------------------------------------------------
sales_prelim already numeric; no replace
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               12   ->   36          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------
variable sales_prelim was long now double
(36 real changes made)
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               36   ->   12          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------
(file /scratch/jtatarka/14755312/St926396.000013 not found)
file /scratch/jtatarka/14755312/St926396.000013 saved as .dta format

. 
. *** 2024 still preliminary data 
. tempfile census_2024

. import excel "${raw_root}/census_monthly_retail_trade/mrtssales92-present_feb
> _2025.xlsx", clear firstrow sheet("`yr'") cellrange(B5:O110)
(14 vars, 105 obs)

. replace B = "food_nsa" if _n == 62
(1 real change made)

. replace B = "limited" if _n == 66
(1 real change made)

. replace B = "food_sa" if _n == 105
(1 real change made)

. keep if _n == 62 | _n == 66 | _n == 105
(102 observations deleted)

. drop CYCUM PYCUM 

. rename Nov2024p Nov2024

.         
. foreach var of varlist _all {
  2.         rename `var' sales_prelim`var'
  3. }

.         
. rename sales_prelimB rest_type

. 
. reshape long sales_prelim, i(rest_type) j(year_month_prelim) string
(j = Apr2024 Aug2024 Feb2024 Jan2024 Jul2024 Jun2024 Mar2024 May2024 Nov2024 Oc
> t2024 Sep2024)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                3   ->   33          
Number of variables                  12   ->   3           
j variable (11 values)                    ->   year_month_prelim
xij variables:
sales_prelimApr2024 sales_prelimAug2024 ... sales_prelimSep2024->sales_prelim
-----------------------------------------------------------------------------

. replace sales_prelim = "" if sales_prelim == "(S)"
(0 real changes made)

. 
. destring sales_prelim, replace
sales_prelim: all characters numeric; replaced as long

. gen year_month_gs = monthly(year_month_prelim, "MY")

. format year_month_gs %tm

. drop year_month_prelim

. reshape wide sales_prelim, i(year_month_gs) j(rest_type) string
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               33   ->   11          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                           sales_prelim   ->   sales_prelimfood_nsa sales_preli
> mfood_sa sales_prelimlimited
-----------------------------------------------------------------------------

. reshape long
(j = food_nsa food_sa limited)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               11   ->   33          
Number of variables                   4   ->   3           
j variable (3 values)                     ->   rest_type
xij variables:
sales_prelimfood_nsa sales_prelimfood_sa sales_prelimlimited->sales_prelim
-----------------------------------------------------------------------------

. replace sales_prelim = (sales_prelim*1000000)
variable sales_prelim was long now double
(33 real changes made)

. format sales_prelim %15.0g

. rename sales_prelim spend_

. 
. reshape wide spend_, i(year_month_gs) j(rest_type) string
(j = food_nsa food_sa limited)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations               33   ->   11          
Number of variables                   3   ->   4           
j variable (3 values)         rest_type   ->   (dropped)
xij variables:
                                 spend_   ->   spend_food_nsa spend_food_sa spe
> nd_limited
-----------------------------------------------------------------------------

.         
. save `census_2024', replace
(file /scratch/jtatarka/14755312/St926396.000014 not found)
file /scratch/jtatarka/14755312/St926396.000014 saved as .dta format

. 
. tempfile census

. 
. forval yr = 1992/2023 {
  2.         append using `census_`yr''
  3. }

. 
. sort year_month_gs 

. save `census', replace
(file /scratch/jtatarka/14755312/St926396.000015 not found)
file /scratch/jtatarka/14755312/St926396.000015 saved as .dta format

. 
. ********************************************************************
. ***** 4. Bring in Employee numbers from BLS 
. ********************************************************************
. 
. ************* Get BLS total # of employees for restaurants (Naics 7225)
. tempfile bls_7225

. import excel "${raw_root}/bls_emp/restaurants_emp_nsa_feb_2025.xlsx", clear f
> irstrow cellrange(A13:D407) 
(4 vars, 394 obs)

. 
. replace Period = substr(Period,2,2)
(394 real changes made)

. destring Period, replace
Period: all characters numeric; replaced as byte

. gen year_month_gs = ym(Year, Period)

. format year_month_gs %tm

. rename Value emp_rest 

. replace emp_rest = emp_rest*1000
(394 real changes made)

. keep year_month_gs emp_rest

. 
. save `bls_7225', replace
(file /scratch/jtatarka/14755312/St926396.000016 not found)
file /scratch/jtatarka/14755312/St926396.000016 saved as .dta format

. 
. ****************** BLS aggregate hours of emp for naics code 722511 (Full-Ser
> vice Restaurants)
. tempfile bls_722511

. import excel "${raw_root}/bls_emp/full_service_emp_nsa_feb_2025.xlsx", clear 
> firstrow cellrange(A13:D407) 
(4 vars, 394 obs)

. 
. replace Period = substr(Period,2,2)
(394 real changes made)

. destring Period, replace
Period: all characters numeric; replaced as byte

. gen year_month_gs = ym(Year, Period)

. format year_month_gs %tm

. rename Value emp_full 

. replace emp_full = emp_full*1000
(394 real changes made)

. keep year_month_gs emp_full

. save `bls_722511', replace
(file /scratch/jtatarka/14755312/St926396.000017 not found)
file /scratch/jtatarka/14755312/St926396.000017 saved as .dta format

. 
. ****************** BLS aggregate hours of emp for Food and Drink Places (NAIC
> S 722) SEASONALLY ADJUSTED
. tempfile bls_722_sa

. import excel "${raw_root}/bls_emp/food_service_emp_sa_feb_2025.xlsx", clear f
> irstrow cellrange(A13:D407) 
(4 vars, 394 obs)

. 
. replace Period = substr(Period,2,2)
(394 real changes made)

. destring Period, replace
Period: all characters numeric; replaced as byte

. gen year_month_gs = ym(Year, Period)

. format year_month_gs %tm

. rename Value emp_food_sa 

. replace emp_food_sa = emp_food_sa*1000
(394 real changes made)

. keep year_month_gs emp_food_sa

. save `bls_722_sa', replace
(file /scratch/jtatarka/14755312/St926396.000018 not found)
file /scratch/jtatarka/14755312/St926396.000018 saved as .dta format

. 
. ****************** BLS aggregate hours of emp for Food and Drink Places (NAIC
> S 722) NOT SEASONALLY ADJUSTED
. tempfile bls_722_nsa

. import excel "${raw_root}/bls_emp/food_service_emp_nsa_feb_2025.xlsx", clear 
> firstrow cellrange(A13:D407) 
(4 vars, 394 obs)

. 
. replace Period = substr(Period,2,2)
(394 real changes made)

. destring Period, replace
Period: all characters numeric; replaced as byte

. gen year_month_gs = ym(Year, Period)

. format year_month_gs %tm

. rename Value emp_food_nsa 

. replace emp_food_nsa = emp_food_nsa*1000
(394 real changes made)

. keep year_month_gs emp_food_nsa

. save `bls_722_nsa', replace
(file /scratch/jtatarka/14755312/St926396.000019 not found)
file /scratch/jtatarka/14755312/St926396.000019 saved as .dta format

. 
. *** merge in emp counts together
. merge 1:1 year_month_gs using `bls_7225', nogen 

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                               394  
    -----------------------------------------

. merge 1:1 year_month_gs using `bls_722511', nogen 

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                               394  
    -----------------------------------------

. merge 1:1 year_month_gs using `bls_722_sa', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                               394  
    -----------------------------------------

. 
. tempfile bls_emp

. ** Create employees for limited service eating places by subtracting the full
>  service employees from all restaurant (naics 7225) employees
. gen emp_limited = emp_rest - emp_full

. keep year_month_gs emp_limited emp_food_sa emp_food_nsa

. save `bls_emp', replace
(file /scratch/jtatarka/14755312/St926396.00001a not found)
file /scratch/jtatarka/14755312/St926396.00001a saved as .dta format

. 
. *****************************************************************************
> ***
. ****** 6. Merge Everything Together
. *****************************************************************************
> ***
. use `census', clear

. 
. merge 1:1 year_month_gs using `bls_emp', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             1
        from master                         1  
        from using                          0  

    Matched                               394  
    -----------------------------------------

. merge 1:1 year_month_gs using `sg', nogen 

    Result                      Number of obs
    -----------------------------------------
    Not matched                           347
        from master                       347  
        from using                          0  

    Matched                                48  
    -----------------------------------------

. merge 1:1 year_month_gs using `deflators', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             1
        from master                         0  
        from using                          1  

    Matched                               395  
    -----------------------------------------

. keep if year_month_gs >= monthly("jan1992", "MY")
(0 observations deleted)

. 
. *****************************************************************************
> ***
. ********** 7. Cleaning and Processing
. *****************************************************************************
> ***
. 
. * Step 1 - Deflate Census Spend (SG Spend is already deflated)
. foreach var of varlist spend_limited spend_food_sa spend_food_nsa {
  2.         gen nominal_`var' = `var'
  3. } 
(1 missing value generated)
(1 missing value generated)
(1 missing value generated)

. replace spend_limited = (100/cpi_limited)*spend_limited 
(395 real changes made, 71 to missing)

. replace spend_food_sa = (100/cpi_food_sa)*spend_food_sa
(394 real changes made)

. replace spend_food_nsa = (100/cpi_food_nsa)*spend_food_nsa 
(394 real changes made)

. gen spend_sg_food_cpi = (100/cpi_food_nsa)*nominal_spend_sg
(348 missing values generated)

. gen spend_limited_food_cpi = (100/cpi_food_nsa)*nominal_spend_limited
(1 missing value generated)

. 
. * Step 2 - gen spend prod and visits prod 
. gen prod_sg = spend_sg/emp_sg 
(348 missing values generated)

. gen visits_prod_sg = visits_sg/emp_sg 
(348 missing values generated)

. gen prod_food_sa = spend_food_sa/emp_food_sa
(2 missing values generated)

. gen prod_food_nsa = spend_food_nsa/emp_food_nsa 
(2 missing values generated)

. gen prod_sg_food_cpi = spend_sg_food_cpi/emp_sg 
(348 missing values generated)

. gen prod_limited_food_cpi = spend_limited_food_cpi/emp_limited 
(2 missing values generated)

. gen prod_limited = spend_limited/emp_limited 
(73 missing values generated)

. 
. ******************
. ** Index to 1992 Avg 
. sort year_month_gs

. foreach var of varlist prod_food_sa prod_food_nsa prod_limited_food_cpi {
  2.         egen `var'_1992 = mean(`var') if year_month_gs <= monthly("dec1992
> ", "MY")
  3.         gen `var'_idx1992 = 100*(`var'/`var'_1992[1])
  4.         drop `var'_1992
  5. }
(384 missing values generated)
(2 missing values generated)
(384 missing values generated)
(2 missing values generated)
(384 missing values generated)
(2 missing values generated)

. 
. *****************
. *** Index to 2019 Avg 
. sort year_month_gs

. foreach var of varlist prod_limited prod_limited_food_cpi prod_sg prod_sg_foo
> d_cpi visits_prod_sg spend_limited emp_limited spend_sg visits_sg emp_sg {
  2.         egen `var'_2019 = mean(`var') if year_month_gs <= monthly("dec2019
> ", "MY") & year_month_gs >= monthly("jan2019", "MY")
  3.         egen m`var'_2019 = max(`var'_2019)
  4.         gen `var'_idx2019 = 100*(`var'/m`var'_2019)
  5.         drop `var'_2019 m`var'_2019
  6. }
(384 missing values generated)
(73 missing values generated)
(384 missing values generated)
(2 missing values generated)
(384 missing values generated)
(348 missing values generated)
(384 missing values generated)
(348 missing values generated)
(384 missing values generated)
(348 missing values generated)
(384 missing values generated)
(72 missing values generated)
(384 missing values generated)
(2 missing values generated)
(384 missing values generated)
(348 missing values generated)
(384 missing values generated)
(348 missing values generated)
(384 missing values generated)
(348 missing values generated)

. 
. label var year_month_gs "Year-Month"

. label var spend_sg_idx2019 "SafeGraph Sales"

. label var visits_sg_idx2019 "SafeGraph Visits"

. label var emp_sg_idx2019 "SafeGraph Employees"

. label var spend_limited_idx2019 "Census Sales"

. label var emp_limited_idx2019 "BLS Employees"

. label var prod_limited_idx2019 "Census/BLS Spend Productivity"

. label var prod_sg_idx2019 "SafeGraph Spend Productivity"

. label var visits_prod_sg_idx2019 "SafeGraph Visits Productivity"

. label var prod_limited_food_cpi_idx2019 "Census/BLS Productivity (Food away f
> rom home CPI)"

. label var prod_sg_food_cpi_idx2019 "SG Productivity (Food away from home CPI)
> "

. 
. *****************************************************************************
> ***
. *** 8. Save Dataset
. *****************************************************************************
> ***
. save "${built_root}/aggregates_build.dta", replace
file
    /project/fagoolsb/service_industries/replication_package/datasets/built/a
    > ggregates_build.dta saved

. 
end of do-file

. 
. **** 3. Run 3_1_gws_build.do
. **** Create panel from raw GWS Magnify data 
. do "${code_built_root}/3_gws_build/3_1_gws_build.do"

. * Author: Joe Tatarka
. * Name: 3_1_gws_build.do
. * Purpose: Combine raw GWS data into a panel of users
. * Basically when I downloaded the GWS data I split it into two parts: a panel
>  of users and the actual app events. This file is cleaning the panel of users
> . Ultimately going to use this panel of users to see the total number of days
>  that users are in the panel for a given month to account for changes in pane
> l over time.
. 
. * Set Global File Paths
. 
. *global root = "/project/fagoolsb/service_industries/replication_package"
. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. *global gws_root = "/project/fagoolsb/generally_useful_datasets/gws_06_17_24_
> pull/clean"
. 
. 
. ************************************************************
. ******* 1. Loop through raw panel files and clean them
. *************************************************************
. local i = 1

. local files : dir "${gws_root}/panel/" files "*.csv"

. quietly foreach file in `files' {

. local k = `i' - 1

. 
. *****************************************************************
. *** 2. Append Cleaned Files Together and Collapse
. *****************************************************************
. use `panel_1', clear 

. quietly forval j = 2/`k' {

. 
. sort date 

. 
. **** We want to see the total number of days that panelists were in the month
>  so we can compute aggregate app usage per day in a given month. We do this t
> o account for changes in the panel; it is not guaranteed that someone will be
>  in the panel for every day in the month.
. gen year_month_gs = ym(year(date), month(date))

. format year_month_gs %tm

. 
. gen panel_days = 1

. collapse (sum) panel_days, by(panelistid year_month_gs)

. collapse (sum) panel_days, by(year_month_gs)

. 
. label var panel_days "Total Panelist Days in Month"

. label var year_month_gs "Year-month"

. 
. ********************************************************************
. *** 3. Sav  Intermediate Dataset
. ********************************************************************
. save "${intermediate_root}/3_gws_build/3_1_gws_panel.dta", replace 
file
    /project/fagoolsb/service_industries/replication_package/datasets/interme
    > diate/3_gws_build/3_1_gws_panel.dta saved

. 
. 
. 
. 
. 
. 
end of do-file

. 
. **** 4. Run 3_2_gws_build.do
. **** Clean app events from raw GWS Magnify data 
. do "${code_built_root}/3_gws_build/3_2_gws_build.do"

. * Author: Joe Tatarka
. * Name: 3_2_gws_build.do
. * Purpose: Combine raw GWS data into aggregate app usage per month 
. * Basically when I downloaded the GWS data I split it into two parts: a panel
>  of users and the actual app events. This file is cleaning the actual app eve
> nts. We want to sum up the total app usage of the delivery and driver apps by
>  month.
. 
. * Set Global File Paths
. *global root = "/project/fagoolsb/service_industries/replication_package"
. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. *global gws_root = "/project/fagoolsb/generally_useful_datasets/gws_06_17_24_
> pull/clean"
. 
. *****************************************************************************
> ****
. ****** 1. Bring in delivery app events
. *****************************************************************************
> ***
. 
. * loop through files and clean them
. local i = 1

. local files : dir "${gws_root}/delivery_apps" files "*.csv"

. quietly foreach file in `files' {

. 
. * append cleaned files
. local k = `i' - 1

. use `delivery_1', clear 

. quietly forval j = 2/`k' {

. 
. *****************************************************************************
> ***
. ****** 2. Clean Appended Data 
. *****************************************************************************
> ***
. sort date

. gen year_month_gs = ym(year(date), month(date))

. format year_month_gs %tm

. 
. *** Clean app names
. replace appdescription = "GH Drivers" if appdescription == "Grubhub for Drive
> rs" // Grubhub driver app name changed partway through the sample period
(3,723,270 real changes made)

. replace appdescription = "Shopper" if appdescription == "Instashopper"
(359 real changes made)

. replace appdescription = "Shopper" if appdescription == "Instacart Shopper"
(38,014,834 real changes made)

. replace appdescription = "Doordash" if appdescription == "DoorDash " // Notic
> e that there is a space after DoorDash in the raw data.
(35,078,819 real changes made)

. 
. ******** Only keep restaurant Delivery and Driver Apps (I originally also dow
> nloaded data for instacart and for apps from specific restaurants chains)
. keep if inlist(appdescription, "GH Drivers", "Dasher", "Fleet by Postmates", 
> "Doordash", "Grubhub", "Postmates", "UberEATS")
(97,850,565 observations deleted)

. 
. *** sum to year-month level, want aggregate app usage by month
. *** I use visible duration as the app usage metric. There are other possible 
> options, but this one seemed the most reasonable to me.
. collapse (sum) visibleduration, by(year_month_gs appdescription)

. 
. ** Put visible duration into minutes (currently in milliseconds)
. replace visibleduration = (visibleduration/(1000*60))
(455 real changes made)

. label var year_month_gs "Year-Month"

. 
. ***** reshape dataset so it is easy to create total delivery and total driver
>  app usage.
. replace appdescription = "GH_Drivers" if appdescription == "GH Drivers"
(65 real changes made)

. replace appdescription = "Fleet_by_Postmates" if appdescription == "Fleet by 
> Postmates"
(65 real changes made)

. rename visibleduration app_use_

. 
. reshape wide app_, i(year_month_gs) j(appdescription) string
(j = Dasher Doordash Fleet_by_Postmates GH_Drivers Grubhub Postmates UberEATS)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations              455   ->   65          
Number of variables                   3   ->   8           
j variable (7 values)    appdescription   ->   (dropped)
xij variables:
                               app_use_   ->   app_use_Dasher app_use_Doordash 
> ... app_use_UberEATS
-----------------------------------------------------------------------------

. rename *, lower

. gen app_use_all_delivery = app_use_doordash + app_use_grubhub + app_use_postm
> ates + app_use_ubereats

. gen app_use_all_driver = app_use_gh_drivers + app_use_dasher + app_use_fleet_
> by_postmates

. 
. *****************************************************************************
> ***
. **** Save Intermediate Dataset
. *****************************************************************************
> ***
. save "${intermediate_root}/3_gws_build/3_2_gws_app_usage.dta", replace
file
    /project/fagoolsb/service_industries/replication_package/datasets/interme
    > diate/3_gws_build/3_2_gws_app_usage.dta saved

. 
. 
. 
end of do-file

. 
. **** 5. Run 3_3_gws_build.do
. **** Combine GWS Magnify panel with app event data to create gws_build.dta
. do "${code_built_root}/3_gws_build/3_3_gws_build.do"

. * Author: Joe Tatarka
. * Name: 3_3_gws_build.do
. * Purpose: Create a build from the GWS data 
. * Combine the GWS Panel and GWS App Delivery to create a final dataset 
. 
. * Set Global File Paths
. *global root = "/project/fagoolsb/service_industries/replication_package"
. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. *global gws_root = "/project/fagoolsb/generally_useful_datasets/gws_06_17_24_
> pull/clean"
. 
. ******************************
. **** Step 1: Bring in the panel 
. use "${intermediate_root}/3_gws_build/3_2_gws_app_usage.dta", clear

. 
. ***********************************************************************
. ******* Step 2: Merge App Usage with how many days the panelist days there ar
> e 
. sort year_month_gs

. merge 1:1 year_month_gs using "${intermediate_root}/3_gws_build/3_1_gws_panel
> .dta", nogen keep(1 3)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                                65  
    -----------------------------------------

. 
. **********************************************************
. **** Step 3: Create App Usage per day for delivery and driver apps
. ** Duration per number of days people are in the panel in that given month
. gen delivery_use_per_day = app_use_all_delivery/panel_days

. gen driver_use_per_day = app_use_all_driver/panel_days

. 
. *** Index to 2019 Average values 
. foreach var of varlist delivery_use_per_day driver_use_per_day {
  2.         egen `var'_2019 = mean(`var') if year_month_gs <= monthly("dec2019
> ", "MY") & year_month_gs >= monthly("jan2019", "MY")
  3.         egen m`var'_2019 = max(`var'_2019)
  4.         gen `var'_idx2019 = 100*(`var'/m`var'_2019)
  5.         drop `var'_2019 m`var'_2019
  6. }
(53 missing values generated)
(53 missing values generated)

. 
. label var delivery_use_per_day "Delivery App Usage (Aggregate Minutes per Day
> )"

. label var delivery_use_per_day "Driver App Usage (Aggregate Minutes per Day)"

. label var delivery_use_per_day_idx2019 "Delivery App Usage (2019 Avg = 100)"

. label var delivery_use_per_day_idx2019 "Driver App Usage (2019 Avg = 100)"

. 
. **** Keep from Jan 2019 - Dec 2023
. keep if year_month_gs >= monthly("jan2019", "MY") & year_month_gs <= monthly(
> "dec2023", "MY")
(5 observations deleted)

. 
. *****************************************************************************
> ***
. **** Save Dataset
. *****************************************************************************
> ***
. save "${built_root}/gws_build.dta", replace
file
    /project/fagoolsb/service_industries/replication_package/datasets/built/g
    > ws_build.dta saved

. 
. 
. 
end of do-file

. 
. **** 6. Run 4_1_homebase_build.do
. **** Clean Homebase data to create homebase_build.dta
. do "${code_built_root}/4_homebase_build/4_1_homebase_build.do"

. * Author: Joe Tatarka
. * Name: 4_1_homebase_build.do
. * Purpose: Take raw homebase data from 2018-2022 and combine into a single cl
> eaned homebase dataset
. 
. * Set Global File Paths
. *global root = "/project/fagoolsb/service_industries/replication_package"
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. *global homebase_root = "/project/fagoolsb/service_industries/data/datasets/r
> aw/homebase"
. 
. *****************************************************************************
> ****
. ***** 1. Bring in and append Raw data
. *****************************************************************************
> ***
. 
. *insheet using "${homebase_root}/hours_worked_only_daily_raw_data_files/2021-
> 07/20210701_hour_worked_daily_file.csv0000_000", clear
. 
. **** Combine July 2021 - January 2023 Raw Data 
. **** They are daily files, but there are duplicates observations as the daily
>  files overlap
. 
. local m = 1

. quietly foreach month in "2021-07" "2021-08" "2021-09" "2021-10" "2021-11" "2
> 021-12" "2022-01" "2022-02" "2022-03" "2022-04" "2022-05" "2022-06" "2022-07"
>  "2022-08" "2022-09" "2022-10" "2022-11" "2022-12" "2023-01" {

. 
. *** Combine in Jan 2018 - June 2021 Data and clean the data
. *** These files are not daily
. 
. local files : dir "${homebase_root}/hours_worked_dataset_historical_files" fi
> les "*"

. local i = 1

. foreach file in `files' {
  2. import delimited "${homebase_root}/hours_worked_dataset_historical_files/`
> file'", clear
  3. 
. drop msa industry business_type 
  4. 
. replace location_created_date =substr(location_created_date,1,10)
  5. replace job_created_date = substr(job_created_date,1,10)
  6. replace job_archived_date = "" if job_archived_date == "\N"
  7. replace job_archived_date = substr(job_archived_date,1,10)
  8. 
. gen emp_level = 1 if level == "Employee"
  9. replace emp_level = 2 if level == "Manager"
 10. replace emp_level = 3 if level == "General Manager"
 11. 
. label define emp_level 1 "Employee" 2 "Manager" 3 "General Manager", replace 
 12. 
. label values emp_level emp_level
 13. drop level 
 14. 
. foreach var in event_date job_archived_date job_created_date location_created
> _date{
 15. gen `var'_1 = date(`var', "YMD")
 16. drop `var' 
 17. rename `var'_1 `var'
 18. format `var' %td
 19. }
 20. 
. destring avg_hourly_wage_rate total_wages_earned naics_code, replace force 
 21. 
. tostring county_code, replace
 22. replace county_code = "" if county_code == "."
 23. replace county_code = "0" + county_code if strlen(county_code) < 5 & count
> y_code != ""
 24. 
. gen file_date = .
 25. 
. compress
 26. 
. order event_date, first 
 27. 
. tempfile homebase_`i'
 28. save `homebase_`i'', replace 
 29. 
. local i = `i' + 1
 30. }
(encoding automatically selected: ISO-8859-1)
(19 vars, 18,273,206 obs)
(18,273,206 real changes made)
(18,273,206 real changes made)
(0 real changes made)
(2,470,561 real changes made)
(1,539,914 missing values generated)
(1,340,695 real changes made)
(199,219 real changes made)
(15,802,645 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(859,384 real changes made)
(4,236,828 real changes made)
(18,273,206 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_archived_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (255,824,884 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000ho not found)
file /scratch/jtatarka/14755312/St926396.0000ho saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 28,877,844 obs)
(28,877,844 real changes made)
(28,877,844 real changes made)
(0 real changes made)
(10,230,633 real changes made)
(2,760,737 missing values generated)
(2,425,996 real changes made)
(334,741 real changes made)
(18,647,211 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(1,238,163 real changes made)
(6,624,264 real changes made)
(28,877,844 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (346,534,128 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hp not found)
file /scratch/jtatarka/14755312/St926396.0000hp saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 28,331,174 obs)
(28,331,174 real changes made)
(28,331,174 real changes made)
(0 real changes made)
(14,833,266 real changes made)
(2,866,664 missing values generated)
(2,612,785 real changes made)
(253,879 real changes made)
(13,497,908 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(1,036,126 real changes made)
(6,780,404 real changes made)
(28,331,174 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (339,974,088 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hq not found)
file /scratch/jtatarka/14755312/St926396.0000hq saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 16,869,472 obs)
(16,869,472 real changes made)
(16,869,472 real changes made)
(0 real changes made)
(5,974,099 real changes made)
(1,613,077 missing values generated)
(1,417,953 real changes made)
(195,124 real changes made)
(10,895,373 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(723,346 real changes made)
(3,871,486 real changes made)
(16,869,472 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (202,433,664 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hr not found)
file /scratch/jtatarka/14755312/St926396.0000hr saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 29,500,312 obs)
(29,500,312 real changes made)
(29,500,312 real changes made)
(0 real changes made)
(3,986,106 real changes made)
(2,481,699 missing values generated)
(2,160,614 real changes made)
(321,085 real changes made)
(25,514,206 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(1,389,117 real changes made)
(6,841,199 real changes made)
(29,500,312 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_archived_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (413,004,368 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hs not found)
file /scratch/jtatarka/14755312/St926396.0000hs saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 22,566,360 obs)
(22,566,360 real changes made)
(22,566,360 real changes made)
(0 real changes made)
(13,763,962 real changes made)
(2,761,924 missing values generated)
(2,576,254 real changes made)
(185,670 real changes made)
(8,802,398 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(601,049 real changes made)
(5,605,211 real changes made)
(22,566,360 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_archived_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (315,929,040 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000ht not found)
file /scratch/jtatarka/14755312/St926396.0000ht saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 27,983,602 obs)
(27,983,602 real changes made)
(27,983,602 real changes made)
(0 real changes made)
(17,074,738 real changes made)
(3,425,218 missing values generated)
(3,195,746 real changes made)
(229,472 real changes made)
(10,908,864 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(744,640 real changes made)
(6,950,788 real changes made)
(27,983,602 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_archived_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (391,770,428 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hu not found)
file /scratch/jtatarka/14755312/St926396.0000hu saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 28,331,452 obs)
(28,331,452 real changes made)
(28,331,452 real changes made)
(0 real changes made)
(14,833,980 real changes made)
(2,865,967 missing values generated)
(2,611,183 real changes made)
(254,784 real changes made)
(13,497,472 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(1,036,733 real changes made)
(6,780,694 real changes made)
(28,331,452 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (339,977,424 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hv not found)
file /scratch/jtatarka/14755312/St926396.0000hv saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 18,320,692 obs)
(18,320,692 real changes made)
(18,320,692 real changes made)
(0 real changes made)
(9,592,086 real changes made)
(1,855,237 missing values generated)
(1,690,673 real changes made)
(164,564 real changes made)
(8,728,606 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(670,087 real changes made)
(4,383,005 real changes made)
(18,320,692 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (219,848,304 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hw not found)
file /scratch/jtatarka/14755312/St926396.0000hw saved as .dta format
(encoding automatically selected: ISO-8859-1)
(19 vars, 28,878,716 obs)
(28,878,716 real changes made)
(28,878,716 real changes made)
(0 real changes made)
(10,228,717 real changes made)
(2,763,651 missing values generated)
(2,429,578 real changes made)
(334,073 real changes made)
(18,649,999 missing values generated)
avg_hourly_wage_rate already numeric; no replace
total_wages_earned already numeric; no replace
naics_code already numeric; no replace
county_code was long now str5
(1,239,575 real changes made)
(6,625,623 real changes made)
(28,878,716 missing values generated)
  variable emp_level was float now byte
  variable event_date was float now int
  variable job_created_date was float now int
  variable location_created_date was float now int
  variable file_date was float now byte
  (346,544,592 bytes saved)
(file /scratch/jtatarka/14755312/St926396.0000hx not found)
file /scratch/jtatarka/14755312/St926396.0000hx saved as .dta format

. 
. use `homebase_1', clear 

. erase `homebase_1'

. foreach j of numlist 2/10 {
  2.         append using `homebase_`j''
  3.         erase `homebase_`j''
  4. }
(variable zip was str17, now str41 to accommodate using data's values)
(variable job_archived_date was int, now float to accommodate using data's
       values)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(variable zip was str41, now str47 to accommodate using data's values)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)

. 
. 
. **** Now append data for months from July 2021 - Jan 2023 
. foreach month of numlist 1/19{
  2.         append using `data_`month''
  3.         erase `data_`month''
  4. }
(variable total_wages_earned was float, now double to accommodate using
       data's values)
(variable avg_hourly_wage_rate was float, now double to accommodate using
       data's values)
(variable file_date was byte, now int to accommodate using data's values)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)
(label emp_level already defined)

. 
. **********************************************************************
. **** 2. Clean the Appended data
. **********************************************************************
. 
. *** drop duplicates 
. bys event_date user_id location_id: egen max_file_date = max(file_date)
(245,125,336 missing values generated)

. duplicates tag  event_date user_id location_id, gen(dup)

Duplicates in terms of event_date user_id location_id

. replace dup = 0 if file_date == max_file_date
(52,477,043 real changes made)

. 
. drop if dup > 0
(57,390,496 observations deleted)

. drop dup max_file_date

. 
. bys user_id event_date location_id: egen max_archive_date = max(job_archived_
> date)
(339,836,706 missing values generated)

. duplicates tag  event_date user_id location_id, gen(dup)

Duplicates in terms of event_date user_id location_id

. replace dup = 0 if job_archived_date == max_archive_date
(12,430 real changes made)

. drop if dup > 0
(102 observations deleted)

. drop dup max_archive_date

. 
. bys user_id event_date location_id: egen max_wage = max(total_wages_earned)
(170,150,823 missing values generated)

. duplicates tag  event_date user_id location_id, gen(dup)

Duplicates in terms of event_date user_id location_id

. replace dup = 0 if total_wages_earned == max_wage
(9,879 real changes made)

. drop if dup > 0
(2,452 observations deleted)

. drop dup max_wage

. 
. ** Keep from 2018-2022
. keep if event_date < date("2023-1-1", "YMD")
(10,534,493 observations deleted)

. 
. *** Only Keep Limited Service Restaurants
. keep if inlist(naics_code, 722513, 722514, 722515) 
(364,025,198 observations deleted)

. 
. *** Drop if not in the USA or if state variable is missing
. drop if state == "Not USA"
(1,452,243 observations deleted)

. replace state = "" if state == "Unclassified"
(918,306 real changes made)

. 
. * drop if county_code is missing or if establishment is in puerto rico
. drop if county_code == ""
(664,345 observations deleted)

. drop if state == "pr"
(1,243,945 observations deleted)

. 
. * drop if no hours worked or missing hours worked
. drop if hours_worked == 0 | hours_worked == .
(146,351 observations deleted)

. 
. *** Create some key variables 
. gen year_month_gs = ym(year(event_date), month(event_date))

. format year_month_gs %tm

. 
. gen shift_less_4 = (hours_worked <4)

. 
. gen less_4_hours = hours_worked if hours_worked <4
(59,842,466 missing values generated)

. 
. gen agg_hours = hours_worked

. 
. * Collapse to Monthly Level 
. collapse (mean) hours_worked shift_less_4 (sum) agg_hours less_4_hours, by(ye
> ar_month_gs)

. 
. ************************************************************
. *** 3. Save Intermediate Homebase Dataset 
. ************************************************************
. save "${built_root}/homebase_build.dta", replace
file
    /project/fagoolsb/service_industries/replication_package/datasets/built/h
    > omebase_build.dta saved

. 
. 
end of do-file

. 
. **** Analysis Code
. **** 7. Run 1_tables_and_figures.do
. **** Create all tables and figures for the paper
. do "${code_exhibits_root}/1_tables_and_figures.do"

. * Author: Joe Tatarka
. * Name: 1_tables_and_figures.do
. * Purpose: Recreate the tables and figures for "The Curious Surge of Producti
> vity in U.S. Restaurants" NBER Working Paper
. 
. * Set Global File Paths
. global root = "/project/fagoolsb/service_industries/replication_package"

. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. *****************************************************************************
> ***
. *** Figure 1 - Real Sales per Emp, Food Services and Drinking Places, Seasona
> lly Adjusted
. *****************************************************************************
> ***
. *** In the paper we put the excel graph, but I am recreating it with Stata
. use "${built_root}/aggregates_build.dta", clear 

. 
. graph twoway line prod_food_sa_idx1992 year_month_gs, ytitle("") yline(100, l
> color(black) lwidth(thin)) ylabel(70(10)130) xlabel(384(48)780)

. graph export "${exhibits_root}/figure_1.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > 1.pdf saved as PDF format

. 
. *****************************************************************************
> ***
. *** Figure 2 - Compare Cenus/BLS Sales and Employees to SafeGraph
. *****************************************************************************
> ***
. use "${built_root}/aggregates_build.dta", clear 

. 
. keep if year_month_gs >= monthly("jan2019", "MY") & year_month_gs <= monthly(
> "dec2022", "MY")
(348 observations deleted)

. 
. sum spend_sg_idx2019

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
spend_s~2019 |         48    105.3469    10.48671   77.37409   122.9059

. gen high = r(max)

. sum emp_sg_idx2019

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
emp_sg_~2019 |         48    97.98459    12.31385   59.37445   118.4945

. gen low = r(min)

. 
. label var spend_limited_idx2019 "Census Sales"

. label var spend_sg_idx2019 "SafeGraph Sales"

. label var emp_limited_idx2019 "BLS Employees"

. label var emp_sg_idx2019 "SafeGraph Employees"

. 
. *** Figure 2a
. graph twoway line spend_limited_idx2019 year_month_gs, lcolor(stc1) lwidth(th
> ick) || line spend_sg_idx2019 year_month_gs, lcolor(stc2) title("") subtitle(
> "") ytitle("") legend(order(1 2) cols(2) position(6)) yline(100, lcolor(black
> ) lwidth(thin)) xscale(range(708 758)) ylabel(60(10)120)

. graph export "${exhibits_root}/figure_2a.pdf", replace 
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > 2a.pdf saved as PDF format

. 
. *** Figure 2b
. graph twoway rarea high low year_month_gs if year_month_gs >= 748, lcolor(gs1
> 4%0) fcolor(gs14%50) || line emp_limited_idx2019 year_month_gs, lcolor(stc1) 
> lwidth(thick) || line emp_sg_idx2019 year_month_gs if year_month_gs <= 747, l
> color(stc2) || line emp_sg_idx2019 year_month_gs if year_month_gs >= 748 , lc
> olor(stc2) title("") subtitle("") ytitle("") legend(order(2 3) cols(2) positi
> on(6)) yline(100, lcolor(black) lwidth(thin)) xscale(range(708 758)) ylabel(6
> 0(10)120)

. graph export "${exhibits_root}/figure_2b.pdf", replace 
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > 2b.pdf saved as PDF format

. 
. *****************************************************************************
> ****
. **** Figure 3, Average SafeGraph Employment per Restaurant 
. *****************************************************************************
> ****
. use "${built_root}/main_build.dta", clear

. 
. * Take monthly average of employment measure 
. collapse (mean) spend visits emp, by(year_month_gs)

. label var year_month_gs "Year-Month"

. 
. ** create index to avg 2019 
. sort year_month_gs

. foreach var in "spend" "visits" "emp" {
  2.         egen `var'_2019 = mean(`var') if year_month_gs <= monthly("dec2019
> ", "MY")
  3.         gen `var'_index = 100*(`var'/`var'_2019[1])
  4. }
(36 missing values generated)
(36 missing values generated)
(36 missing values generated)

. 
. label var emp_index "Average Employee Shifts"

. 
. gen high =  120

. gen low = 60

. graph twoway rarea high low year_month_gs if year_month_gs >= 748, lcolor(gs1
> 4%0) fcolor(gs14%50) || line emp_index year_month_gs if year_month_gs <=747, 
> lcolor(stc1) || line emp_index year_month_gs if year_month_gs >= 748, lcolor(
> stc1) ytitle("") legend(off) yline(100, lcolor(black) lwidth(thin)) xscale(ra
> nge(708 758)) ylabel(60(10)120) 

. graph export "${exhibits_root}/figure_3.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > 3.pdf saved as PDF format

. 
. *****************************************************************************
> ***
. **** Figure 4, Average Customer Dwell Time Visit Shares
. *****************************************************************************
> ***
. use "${built_root}/main_build.dta", clear

. 
. ** Take Monthly Average of Dwell Shares
. collapse (mean) dwell_0_to_10_share dwell_11_to_20_share dwell_21_to_60_share
>  dwell_61_to_240_share, by(year_month_gs)

. 
. label var dwell_0_to_10_share "0-10 Minutes"

. label var dwell_11_to_20_share "11-20 Minutes"

. label var dwell_21_to_60_share "21-60 Minutes"

. label var dwell_61_to_240_share "61-240 Minutes"

. label var year_month_gs "Year-Month"

. 
. gen high = 0.7

. gen low = 0

. 
. graph twoway rarea high low year_month_gs if year_month_gs >=748, lcolor(gs14
> %0) fcolor(gs14%50) || line dwell_0_to_10_share year_month_gs if year_month_g
> s <= 747, lcolor(stc1) || line dwell_0_to_10_share year_month_gs if year_mont
> h_gs >= 748, lcolor(stc1) || line dwell_11_to_20_share year_month_gs if year_
> month_gs <= 747, lcolor(stc2) || line dwell_11_to_20_share year_month_gs if y
> ear_month_gs >= 748, lcolor(stc2) || line dwell_21_to_60_share year_month_gs 
> if year_month_gs <= 747, lcolor(stc3) || line dwell_21_to_60_share year_month
> _gs if year_month_gs >= 748, lcolor(stc3) || line dwell_61_to_240_share year_
> month_gs if year_month_gs <= 747, lcolor(stc4) || line dwell_61_to_240_share 
> year_month_gs if year_month_gs >= 748, lcolor(stc4) title("") ytitle("Share o
> f Visits") ylabel(0(0.1)0.7, format(%3.1fc)) legend(order(2 4 6 8) cols(2) po
> sition(6))  xscale(range(708 758)) 

. graph export "${exhibits_root}/figure_4.pdf", replace 
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > 4.pdf saved as PDF format

. 
. *****************************************************************************
> ***
. **** Table 1, Table A1, Figure A4, Figure A5, Figure A6
. **** Dwell Time Changes and Productivity Regressions 
. *****************************************************************************
> ***
. *** Easier to make all of these tables and figures in one fell swoop
. use "${built_root}/main_build.dta", clear

. 
. *** Shorten Brand Names
. replace brands = "Domino's" if brands == "Domino's Pizza"
(254,312 real changes made)

. replace brands = "Chipotle" if brands == "Chipotle Mexican Grill"
(111,568 real changes made)

. 
. *** Create Indicator Variables for all brands + entire sample
. gen brands_1 = 1

. label var brands_1 "All Restaurants"

. local i = 2

. foreach brands in  "McDonald's" "Chick-fil-A" "Taco Bell" "Wendy's" "Burger K
> ing" "Starbucks" "Dunkin'" "Subway" "Chipotle" "Domino's" "Pizza Hut"  {
  2.         gen brands_`i' = (brands == "`brands'")
  3.         label var brands_`i' "`brands'"
  4.         local i = `i' + 1
  5. }

. 
. *** Create frame with the change in avg dwell shares 
. *** create like 48 vars of dwell share * brand dummy and then collapse to yea
> r_month 
. *** Use this same frame throughout the mega loop
. 
. frame copy default new, replace
(note: frame new not found)

. 
. frame new {
.         foreach var of varlist brands_1-brands_12 {
  2.                 foreach dwell_var of varlist dwell_0_to_10_share dwell_11_
> to_20_share dwell_21_to_60_share dwell_61_to_240_share {
  3.                         gen `var'_`dwell_var' = `dwell_var' if `var' == 1
  4.                 }
  5.         }
(5,133,473 missing values generated)
(5,133,473 missing values generated)
(5,133,473 missing values generated)
(5,133,473 missing values generated)
(5,625,899 missing values generated)
(5,625,899 missing values generated)
(5,625,899 missing values generated)
(5,625,899 missing values generated)
(5,461,283 missing values generated)
(5,461,283 missing values generated)
(5,461,283 missing values generated)
(5,461,283 missing values generated)
(5,487,180 missing values generated)
(5,487,180 missing values generated)
(5,487,180 missing values generated)
(5,487,180 missing values generated)
(5,480,633 missing values generated)
(5,480,633 missing values generated)
(5,480,633 missing values generated)
(5,480,633 missing values generated)
(5,366,082 missing values generated)
(5,366,082 missing values generated)
(5,366,082 missing values generated)
(5,366,082 missing values generated)
(5,398,214 missing values generated)
(5,398,214 missing values generated)
(5,398,214 missing values generated)
(5,398,214 missing values generated)
(5,146,199 missing values generated)
(5,146,199 missing values generated)
(5,146,199 missing values generated)
(5,146,199 missing values generated)
(5,602,858 missing values generated)
(5,602,858 missing values generated)
(5,602,858 missing values generated)
(5,602,858 missing values generated)
(5,460,114 missing values generated)
(5,460,114 missing values generated)
(5,460,114 missing values generated)
(5,460,114 missing values generated)
(5,554,795 missing values generated)
(5,554,795 missing values generated)
(5,554,795 missing values generated)
(5,554,795 missing values generated)
.         
.         collapse (mean) brands_1_dwell_0_to_10_share - brands_12_dwell_61_to_
> 240_share, by(year_month_gs)
. }

. 
. label var dwell_0_to_10_share "0-10 Minutes"

. label var dwell_11_to_20_share "11-20 Minutes"

. label var dwell_21_to_60_share "21-60 Minutes"

. 
. **** REGRESSION TIME 
. ** Loop through and run regression for each restaurant chain + entire sample
. ** Basically: run regression, multiply regression coefficients by the change 
> in dwell shares to create implied productivity change, and then continue to n
> ext restaurant chain
. est clear

. foreach num of numlist 1/12 {
  2.         local reg_title_`num': var label brands_`num'
  3.         * regression
.         quietly: eststo, title("`reg_title_`num''"): reghdfe ln_spend_prod dw
> ell_0_to_10_share dwell_11_to_20_share dwell_21_to_60_share if brands_`num' =
> = 1, absorb(placekey year_month_gs) vce(cluster placekey)
  4.                 
.         frame change new 
  5.         gen brands_`num'_diff = 0
  6.         gen brands_`num'_lb = 0 
  7.         gen brands_`num'_ub = 0
  8.         
.         foreach dwell in "dwell_0_to_10" "dwell_11_to_20" "dwell_21_to_60" "d
> well_61_to_240" {
  9.                 quietly: sum brands_`num'_`dwell'_share if year_month_gs <
> = monthly("dec2019", "MY")
 10.                 local `dwell'_2019 = r(mean)
 11.         }
 12.         
.         quietly: foreach n of numlist 1(1)48 {
 13.                 local 0_10_diff = brands_`num'_dwell_0_to_10_share[`n'] - 
> `dwell_0_to_10_2019'
 14.                 local 11_20_diff = brands_`num'_dwell_11_to_20_share[`n'] 
> - `dwell_11_to_20_2019' 
 15.                 local 21_60_diff = brands_`num'_dwell_21_to_60_share[`n'] 
> - `dwell_21_to_60_2019'
 16.         
.                 * Multiply coefficients by change from 2019 avg
.                 lincom `0_10_diff'*dwell_0_to_10_share + `11_20_diff'*dwell_1
> 1_to_20_share + `21_60_diff'*dwell_21_to_60_share
 17.                 replace brands_`num'_diff = r(estimate) if _n == `n'
 18.                 replace brands_`num'_lb = r(lb) if _n == `n'
 19.                 replace brands_`num'_ub = r(ub) if _n == `n'
 20.         }
 21. 
.         *** Estadd Some Locals (Change from 2019 avg to April 2022)
.         foreach dwell in "dwell_0_to_10" "dwell_11_to_20" "dwell_21_to_60" "d
> well_61_to_240" {
 22.                 estadd scalar `dwell'_change = brands_`num'_`dwell'_share[
> 40] - ``dwell'_2019'
 23.         }
 24.         estadd scalar projected_prod =  100*brands_`num'_diff[40]
 25.         
.         frame change default 
 26.         
. }

added scalar:
e(dwell_0_to_10_change) =  .08105503

added scalar:
e(dwell_11_to_20_change) =  -.02310383

added scalar:
e(dwell_21_to_60_change) =  -.04482081

added scalar:
e(dwell_61_to_240_change) =  -.01313038

added scalar:
     e(projected_prod) =  11.267336

added scalar:
e(dwell_0_to_10_change) =  .09883659

added scalar:
e(dwell_11_to_20_change) =  -.0129367

added scalar:
e(dwell_21_to_60_change) =  -.06253728

added scalar:
e(dwell_61_to_240_change) =  -.0233626

added scalar:
     e(projected_prod) =  22.363538

added scalar:
e(dwell_0_to_10_change) =  .08814804

added scalar:
e(dwell_11_to_20_change) =  .00443633

added scalar:
e(dwell_21_to_60_change) =  -.07971024

added scalar:
e(dwell_61_to_240_change) =  -.01287411

added scalar:
     e(projected_prod) =  14.178148

added scalar:
e(dwell_0_to_10_change) =  .10378881

added scalar:
e(dwell_11_to_20_change) =  -.02704672

added scalar:
e(dwell_21_to_60_change) =  -.06474116

added scalar:
e(dwell_61_to_240_change) =  -.01200096

added scalar:
     e(projected_prod) =  19.44139

added scalar:
e(dwell_0_to_10_change) =  .12116447

added scalar:
e(dwell_11_to_20_change) =  -.01913994

added scalar:
e(dwell_21_to_60_change) =  -.0861452

added scalar:
e(dwell_61_to_240_change) =  -.01587935

added scalar:
     e(projected_prod) =  22.385374

added scalar:
e(dwell_0_to_10_change) =  .11575441

added scalar:
e(dwell_11_to_20_change) =  -.02560107

added scalar:
e(dwell_21_to_60_change) =  -.07132115

added scalar:
e(dwell_61_to_240_change) =  -.01883219

added scalar:
     e(projected_prod) =  22.814026

added scalar:
e(dwell_0_to_10_change) =  .09125125

added scalar:
e(dwell_11_to_20_change) =  -.01031001

added scalar:
e(dwell_21_to_60_change) =  -.04531401

added scalar:
e(dwell_61_to_240_change) =  -.03562722

added scalar:
     e(projected_prod) =  22.037822

added scalar:
e(dwell_0_to_10_change) =  .08406928

added scalar:
e(dwell_11_to_20_change) =  -.02092761

added scalar:
e(dwell_21_to_60_change) =  -.03621452

added scalar:
e(dwell_61_to_240_change) =  -.02692713

added scalar:
     e(projected_prod) =  19.667013

added scalar:
e(dwell_0_to_10_change) =  .06848093

added scalar:
e(dwell_11_to_20_change) =  -.03585238

added scalar:
e(dwell_21_to_60_change) =  -.0262796

added scalar:
e(dwell_61_to_240_change) =  -.00634896

added scalar:
     e(projected_prod) =  6.0128462

added scalar:
e(dwell_0_to_10_change) =  .06472612

added scalar:
e(dwell_11_to_20_change) =  -.02904172

added scalar:
e(dwell_21_to_60_change) =  -.03348103

added scalar:
e(dwell_61_to_240_change) =  -.00220337

added scalar:
     e(projected_prod) =  7.8634955

added scalar:
e(dwell_0_to_10_change) =  .05028691

added scalar:
e(dwell_11_to_20_change) =  -.03207269

added scalar:
e(dwell_21_to_60_change) =  -.01386967

added scalar:
e(dwell_61_to_240_change) =  -.00434455

added scalar:
     e(projected_prod) =  4.3639015

added scalar:
e(dwell_0_to_10_change) =  .07624102

added scalar:
e(dwell_11_to_20_change) =  -.02945922

added scalar:
e(dwell_21_to_60_change) =  -.05023051

added scalar:
e(dwell_61_to_240_change) =  .00344869

added scalar:
     e(projected_prod) =  1.8999999

. *** Table 1, Regression Table
. ** We do some manual editing after to make the tables look nicer for the pape
> r
. esttab est1 est2 est3 est4 est5 est6 using "${exhibits_root}/table_1.rtf", no
> star onecell mtitle se noomitted nocons nobase compress stats(N r2, label("N"
>  "R-Squared") fmt(%9.0fc 2)) label replace title("Table 1") nonote collabel(n
> one)
(output written to /project/fagoolsb/service_industries/replication_package/exh
> ibits/table_1.rtf)

. 
. esttab est1 est2 est3 est4 est5 est6 using "${exhibits_root}/table_1.rtf", no
> star nomtitle nonum se drop(_cons dwell_0_to_10_share dwell_11_to_20_share dw
> ell_21_to_60_share) compress stats( dwell_0_to_10_change dwell_11_to_20_chang
> e dwell_21_to_60_change dwell_61_to_240_change projected_prod, label("0-10 Mi
> nutes" "11-20 Minutes" "21-60 Minutes" "61-240 Minutes" "Impl. Change % Produ
> ctivity") fmt(3 3 3 3 1)) label append  title("Average dwell time category sh
> are change from 2019 to April 2022 and implied productivity change:")
(output written to /project/fagoolsb/service_industries/replication_package/exh
> ibits/table_1.rtf)

. 
. *** Table A1, Regression Table - Additional Restaurant Chains
. ** We do some manual editing after to make the tables look nicer for the pape
> r
. esttab est7 est8 est9 est10 est11 est12 using "${exhibits_root}/table_A1.rtf"
> , nostar onecell mtitle se noomitted nocons nobase compress stats(N r2, label
> ("N" "R-Squared") fmt(%9.0fc 2)) label replace title("Table A1") nonote colla
> bel(none)
(output written to /project/fagoolsb/service_industries/replication_package/exh
> ibits/table_A1.rtf)

. 
. esttab est7 est8 est9 est10 est11 est12 using "${exhibits_root}/table_A1.rtf"
> , nostar nomtitle nonum se drop(_cons dwell_0_to_10_share dwell_11_to_20_shar
> e dwell_21_to_60_share) compress stats( dwell_0_to_10_change dwell_11_to_20_c
> hange dwell_21_to_60_change dwell_61_to_240_change projected_prod, label("0-1
> 0 Minutes" "11-20 Minutes" "21-60 Minutes" "61-240 Minutes" "Impl. Change % P
> roductivity") fmt(3 3 3 3 1)) label append  title("Average dwell time categor
> y share change from 2019 to April 2022 and implied productivity change:") 
(output written to /project/fagoolsb/service_industries/replication_package/exh
> ibits/table_A1.rtf)

. 
. 
. **** Figure A4, Productivity Projections 
. frame new {
. 
.         gen high = 0.5
.         gen low = -0.1
.         
.         foreach num of numlist 1/6 {
  2.                 label var brands_`num'_diff "`reg_title_`num''"
  3.         }
.         
.         label var year_month_gs "Year-Month"
.         graph twoway rarea high low year_month_gs if year_month_gs >= 748, lc
> olor(gs14%0) fcolor(gs14%50) || line brands_1_diff brands_2_diff brands_3_dif
> f brands_4_diff brands_5_diff brands_6_diff year_month_gs if year_month_gs <=
> 747, lcolor(black stc1 stc2 stc3 stc4 stc5) lwidth(thick) || line brands_1_di
> ff brands_2_diff brands_3_diff brands_4_diff brands_5_diff brands_6_diff year
> _month_gs if year_month_gs >=748, lcolor(black stc1 stc2 stc3 stc4 stc5) lwid
> th(thick) yline(0, lcolor(black) lwidth(thin)) title("") ylabel(-0.1(0.1)0.5,
>  format(%3.1fc)) ytitle("Productivity Difference, Log Scale") legend(order(6 
> 7 5 3 4 2)) 
.         graph export "${exhibits_root}/figure_A4.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > A4.pdf saved as PDF format
. }

. 
. **** Figure A5, Productivity Projections - Additional Restaurant Chains 
. frame new {
.         
.         foreach num of numlist 7/12 {
  2.                 label var brands_`num'_diff "`reg_title_`num''"
  3.         }
.         
.         label var year_month_gs "Year-Month"
.         graph twoway rarea high low year_month_gs if year_month_gs >= 748, lc
> olor(gs14%0) fcolor(gs14%50) || line brands_7_diff brands_8_diff brands_9_dif
> f brands_10_diff brands_11_diff brands_12_diff year_month_gs if year_month_gs
>  <=747, lcolor(stc6 stc7 stc8 stc9 stc10 stc11)  || line brands_7_diff brands
> _8_diff brands_9_diff brands_10_diff brands_11_diff brands_12_diff year_month
> _gs if year_month_gs >=748, lcolor(stc6 stc7 stc8 stc9 stc10 stc11) yline(0, 
> lcolor(black) lwidth(thin)) title("") ylabel(-0.1(0.1)0.5, format(%3.1fc)) yt
> itle("Productivity Difference, Log Scale") legend(order(2 5 3 7 6 4)) 
.         graph export "${exhibits_root}/figure_A5.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > A5.pdf saved as PDF format
. }

. 
. 
. *****************************************************************************
> **
. ***** Figure A1 - Real Sales per Emp, Food Services and Drinking Places and L
> imited Service, Not Seasonally Adjusted
. *****************************************************************************
> **
. **** Paper uses excel graph, but I recreate here in Stata
. use "${built_root}/aggregates_build.dta", clear 

. 
. label var prod_food_nsa_idx1992 "Total Industry"

. label var prod_limited_food_cpi_idx1992 "Limited Service"

. 
. graph twoway line prod_food_nsa_idx1992 prod_limited_food_cpi_idx1992 year_mo
> nth_gs, ytitle("") legend(order(1 2) cols(2) position(6)) yline(100, lcolor(b
> lack) lwidth(thin)) ylabel(80(10)140) xlabel(384(48)780) 

. graph export "${exhibits_root}/figure_A1.pdf", replace 
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > A1.pdf saved as PDF format

. 
. *****************************************************************************
> **
. ***** Figure A2 - Compare Census/BLS Productivity to SafeGraph Productivity
. *****************************************************************************
> **
. use "${built_root}/aggregates_build.dta", clear 

. 
. keep if year_month_gs >= monthly("jan2019", "MY") & year_month_gs <= monthly(
> "dec2022", "MY")
(348 observations deleted)

. 
. gen high = 140 

. gen low = 80

. 
. label var prod_limited_idx2019 "Census/BLS Spend Productivity"

. label var prod_sg_idx2019  "SafeGraph Spend Productivity"

. label var visits_prod_sg_idx2019 "SafeGraph Visits Productivity"

. 
. graph twoway rarea high low year_month_gs if year_month_gs >=748, lcolor(gs14
> %0) fcolor(gs14%50) || line prod_limited_idx2019 year_month_gs, lcolor(stc1) 
> lwidth(thick) || line prod_sg_idx2019 year_month_gs if year_month_gs <= 747, 
> lcolor(stc2) || line prod_sg_idx2019 year_month_gs if year_month_gs >= 748, l
> color(stc2) || line visits_prod_sg_idx2019 year_month_gs if year_month_gs <= 
> 747, lcolor(stc3) || line visits_prod_sg_idx2019 year_month_gs if year_month_
> gs >= 748, lcolor(stc3) title("") subtitle("") ytitle("") legend(order(2 3 5)
>  cols(2) position(6)) yline(100, lcolor(black) lwidth(thin)) xscale(range(708
>  758))  ylabel(80(10)140)

. graph export "${exhibits_root}/figure_A2.pdf", replace 
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > A2.pdf saved as PDF format

. 
. *****************************************************************************
> **
. **** Figure A3, Delivery and Driver App Usage, Aggregate Minutes per Day
. *****************************************************************************
> ***
. use "${built_root}/gws_build.dta", clear

. 
. label var delivery_use_per_day_idx2019 "Delivery Apps"

. label var driver_use_per_day_idx2019 "Driver Apps"

. 
. graph twoway line delivery_use_per_day_idx2019 driver_use_per_day_idx2019 yea
> r_month_gs, title("") ytitle("") yline(100, lcolor(black) lwidth(thin)) legen
> d(pos(6) col(2) label(1 "Delivery Apps") label(2 "Driver Apps")) xlabel(708(1
> 2)768) xscale(range(708 770))

. graph export "${exhibits_root}/figure_A3.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > A3.pdf saved as PDF format

. 
. *****************************************************************************
> ***
. **** Figure A6, Implied Productivity Difference from Dwell Time Changes, Prod
> uctivity Measured as Customer Visits per Employee 
. *****************************************************************************
> ***
. use "${built_root}/main_build.dta", clear

. 
. *** Shorten Brand Names
. replace brands = "Domino's" if brands == "Domino's Pizza"
(254,312 real changes made)

. replace brands = "Chipotle" if brands == "Chipotle Mexican Grill"
(111,568 real changes made)

. 
. *** Create Indicator Variables for restaurant chains + entire sample
. gen brands_1 = 1

. label var brands_1 "All Restaurants"

. local i = 2

. foreach brands in  "McDonald's" "Chick-fil-A" "Taco Bell" "Wendy's" "Burger K
> ing" "Starbucks" "Dunkin'" "Subway" "Chipotle" "Domino's" "Pizza Hut"  {
  2.         gen brands_`i' = (brands == "`brands'")
  3.         label var brands_`i' "`brands'"
  4.         local i = `i' + 1
  5. }

. 
. frame copy default new, replace

. 
. frame new {
.         foreach var of varlist brands_1-brands_12 {
  2.                 foreach dwell_var of varlist dwell_0_to_10_share dwell_11_
> to_20_share dwell_21_to_60_share dwell_61_to_240_share {
  3.                         gen `var'_`dwell_var' = `dwell_var' if `var' == 1
  4.                 }
  5.         }
(5,133,473 missing values generated)
(5,133,473 missing values generated)
(5,133,473 missing values generated)
(5,133,473 missing values generated)
(5,625,899 missing values generated)
(5,625,899 missing values generated)
(5,625,899 missing values generated)
(5,625,899 missing values generated)
(5,461,283 missing values generated)
(5,461,283 missing values generated)
(5,461,283 missing values generated)
(5,461,283 missing values generated)
(5,487,180 missing values generated)
(5,487,180 missing values generated)
(5,487,180 missing values generated)
(5,487,180 missing values generated)
(5,480,633 missing values generated)
(5,480,633 missing values generated)
(5,480,633 missing values generated)
(5,480,633 missing values generated)
(5,366,082 missing values generated)
(5,366,082 missing values generated)
(5,366,082 missing values generated)
(5,366,082 missing values generated)
(5,398,214 missing values generated)
(5,398,214 missing values generated)
(5,398,214 missing values generated)
(5,398,214 missing values generated)
(5,146,199 missing values generated)
(5,146,199 missing values generated)
(5,146,199 missing values generated)
(5,146,199 missing values generated)
(5,602,858 missing values generated)
(5,602,858 missing values generated)
(5,602,858 missing values generated)
(5,602,858 missing values generated)
(5,460,114 missing values generated)
(5,460,114 missing values generated)
(5,460,114 missing values generated)
(5,460,114 missing values generated)
(5,554,795 missing values generated)
(5,554,795 missing values generated)
(5,554,795 missing values generated)
(5,554,795 missing values generated)
.         
.         collapse (mean) brands_1_dwell_0_to_10_share - brands_12_dwell_61_to_
> 240_share, by(year_month_gs)
. }

. 
. label var dwell_0_to_10_share "0-10 Minutes"

. label var dwell_11_to_20_share "11-20 Minutes"

. label var dwell_21_to_60_share "21-60 Minutes"

. 
. **** REGRESSION TIME 
. est clear

. foreach num of numlist 1/6 {
  2.         local reg_title_`num': var label brands_`num'
  3.         quietly: eststo, title("`reg_title_`num''"): reghdfe ln_visits_pro
> d dwell_0_to_10_share dwell_11_to_20_share dwell_21_to_60_share if brands_`nu
> m' == 1, absorb(placekey year_month_gs) vce(cluster placekey)
  4.                 
.         frame change new 
  5.         
.         gen brands_`num'_diff = 0
  6.         gen brands_`num'_lb = 0 
  7.         gen brands_`num'_ub = 0
  8.         
.         foreach dwell in "dwell_0_to_10" "dwell_11_to_20" "dwell_21_to_60" "d
> well_61_to_240" {
  9.                 quietly: sum brands_`num'_`dwell'_share if year_month_gs <
> = monthly("dec2019", "MY")
 10.                 local `dwell'_2019 = r(mean)
 11.         }
 12.         
.         quietly: foreach n of numlist 1(1)48 {
 13.                 local 0_10_diff = brands_`num'_dwell_0_to_10_share[`n'] - 
> `dwell_0_to_10_2019'
 14.                 local 11_20_diff = brands_`num'_dwell_11_to_20_share[`n'] 
> - `dwell_11_to_20_2019' 
 15.                 local 21_60_diff = brands_`num'_dwell_21_to_60_share[`n'] 
> - `dwell_21_to_60_2019'
 16.         
.                 lincom `0_10_diff'*dwell_0_to_10_share + `11_20_diff'*dwell_1
> 1_to_20_share + `21_60_diff'*dwell_21_to_60_share
 17.                 replace brands_`num'_diff = r(estimate) if _n == `n'
 18.                 replace brands_`num'_lb = r(lb) if _n == `n'
 19.                 replace brands_`num'_ub = r(ub) if _n == `n'
 20.         }
 21. 
.         *** Estadd Some Locals (Change from 2019 avg to April 2022)
.         foreach dwell in "dwell_0_to_10" "dwell_11_to_20" "dwell_21_to_60" "d
> well_61_to_240" {
 22.                 estadd scalar `dwell'_change = brands_`num'_`dwell'_share[
> 40] - ``dwell'_2019'
 23.         }
 24.         estadd scalar projected_prod =  100*brands_`num'_diff[40]
 25.         
.         frame change default    
 26. }

added scalar:
e(dwell_0_to_10_change) =  .08105503

added scalar:
e(dwell_11_to_20_change) =  -.02310383

added scalar:
e(dwell_21_to_60_change) =  -.04482081

added scalar:
e(dwell_61_to_240_change) =  -.01313038

added scalar:
     e(projected_prod) =  2.8242188

added scalar:
e(dwell_0_to_10_change) =  .09883659

added scalar:
e(dwell_11_to_20_change) =  -.0129367

added scalar:
e(dwell_21_to_60_change) =  -.06253728

added scalar:
e(dwell_61_to_240_change) =  -.0233626

added scalar:
     e(projected_prod) =  18.190575

added scalar:
e(dwell_0_to_10_change) =  .08814804

added scalar:
e(dwell_11_to_20_change) =  .00443633

added scalar:
e(dwell_21_to_60_change) =  -.07971024

added scalar:
e(dwell_61_to_240_change) =  -.01287411

added scalar:
     e(projected_prod) =  6.0418673

added scalar:
e(dwell_0_to_10_change) =  .10378881

added scalar:
e(dwell_11_to_20_change) =  -.02704672

added scalar:
e(dwell_21_to_60_change) =  -.06474116

added scalar:
e(dwell_61_to_240_change) =  -.01200096

added scalar:
     e(projected_prod) =  9.7570583

added scalar:
e(dwell_0_to_10_change) =  .12116447

added scalar:
e(dwell_11_to_20_change) =  -.01913994

added scalar:
e(dwell_21_to_60_change) =  -.0861452

added scalar:
e(dwell_61_to_240_change) =  -.01587935

added scalar:
     e(projected_prod) =  15.603283

added scalar:
e(dwell_0_to_10_change) =  .11575441

added scalar:
e(dwell_11_to_20_change) =  -.02560107

added scalar:
e(dwell_21_to_60_change) =  -.07132115

added scalar:
e(dwell_61_to_240_change) =  -.01883219

added scalar:
     e(projected_prod) =  15.111998

. 
. **** Graph Figure A6
. frame new {
.         
.         foreach num of numlist 1/6 {
  2.                 label var brands_`num'_diff "`reg_title_`num''"
  3.         }
.         gen high = 0.5
.         gen low = -0.1
.         
.         label var year_month_gs "Year-Month"
.         graph twoway rarea high low year_month_gs if year_month_gs >= 748, lc
> olor(gs14%0) fcolor(gs14%50) || line brands_1_diff brands_2_diff brands_3_dif
> f brands_4_diff brands_5_diff brands_6_diff year_month_gs if year_month_gs <=
> 747, lcolor(black stc1 stc2 stc3 stc4 stc5) lwidth(thick) || line brands_1_di
> ff brands_2_diff brands_3_diff brands_4_diff brands_5_diff brands_6_diff year
> _month_gs if year_month_gs >=748, lcolor(black stc1 stc2 stc3 stc4 stc5) lwid
> th(thick) yline(0, lcolor(black) lwidth(thin)) title("") ylabel(-0.1(0.1)0.5,
>  format(%3.1fc)) ytitle("Productivity Difference, Log Scale") legend(order(6 
> 7 3 5 4 2)) 
.         graph export "${exhibits_root}/figure_A6.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/figure_
    > A6.pdf saved as PDF format
. }

. 
end of do-file

. 
. **** 8. Run 2_additional_analysis.do
. **** Create additional statistics referenced in the paper
. do "${code_exhibits_root}/2_additional_analysis.do"

. * Author: Joe Tatarka
. * Name: 2_additional_analysis.do
. * Purpose: Recreate the extra little statistics in the paper such as correlat
> ions and small data work with Homebase and the National Restaurant Associatio
> n 
. 
. * Set Global File Paths
. global root = "/project/fagoolsb/service_industries/replication_package"

. 
. global raw_root = "${root}/datasets/raw"

. global intermediate_root = "${root}/datasets/intermediate"

. global built_root = "${root}/datasets/built"

. global exhibits_root = "${root}/exhibits"

. 
. *****************************************************************************
> **
. **** 1. Compare SafeGraph with National Restaurant Association Data
. *****************************************************************************
> **
. ** Load in Data
. import excel "${raw_root}/national_restaurant_association/rpi_march_13_2024.x
> ls", clear
(18 vars, 615 obs)

. 
. ** Clean the data 
. 
. keep A E F G

. 
. rename A year_month

. rename E sales_index 

. rename F visits_index 

. rename G labor_index 

. 
. drop in 1/6
(6 observations deleted)

. 
. destring sales_index visits_index labor_index, replace 
sales_index: all characters numeric; replaced as double
(349 missing values generated)
visits_index: all characters numeric; replaced as double
(349 missing values generated)
labor_index: all characters numeric; replaced as double
(349 missing values generated)

. drop if year_month == ""
(349 observations deleted)

. 
. gen year_month_gs = monthly(substr(year_month,3,7),"MY")
(155 missing values generated)

. format year_month_gs %tm

. 
. keep if year_month_gs >= monthly("jan2019", "MY") & year_month_gs != .
(199 observations deleted)

. 
. drop year_month 

. order year_month_gs , first

. 
. * save as tempfile 
. tempfile nra_data 

. save `nra_data', replace
(file /scratch/jtatarka/14755312/St926396.000001 not found)
file /scratch/jtatarka/14755312/St926396.000001 saved as .dta format

. 
. *****************************************
. ***** Bring in all of the sg/visits data 
. 
. * use in 1/1000 using "${data_root}/main_build.dta", clear
. use "${built_root}/main_build.dta", clear

. 
. label variable year_month_gs "Year-month"

. keep placekey year_month_gs nominal_spend emp visits

. sort placekey year_month_gs

. 
. ** xtset 
. egen id = group(placekey)

. xtset id year_month_gs

Panel variable: id (unbalanced)
 Time variable: year_month_gs, 2019m1 to 2022m12, but with gaps
         Delta: 1 month

. 
. *** Create year lagged variables 
. gen lagged_spend = L12.nominal_spend
(1,907,647 missing values generated)

. gen lagged_emp = L12.emp
(1,907,647 missing values generated)

. gen lagged_visits = L12.visits
(1,907,647 missing values generated)

. 
. ***** Create dummies to check if spending/visits/emp is more or less than a y
> ear ago
. gen more_spend_dummy = (nominal_spend > lagged_spend)

. replace more_spend_dummy = . if (nominal_spend == . | lagged_spend == .)
(1,907,647 real changes made, 1,907,647 to missing)

. gen less_spend_dummy = (nominal_spend < lagged_spend)

. replace less_spend_dummy = . if (nominal_spend == . | lagged_spend == .)
(1,907,647 real changes made, 1,907,647 to missing)

. 
. gen more_emp_dummy = (emp > lagged_emp)

. replace more_emp_dummy = . if (emp == . | lagged_emp == .)
(1,907,647 real changes made, 1,907,647 to missing)

. gen less_emp_dummy = (emp < lagged_emp)

. replace less_emp_dummy = . if (emp == . | lagged_emp == .)
(1,907,647 real changes made, 1,907,647 to missing)

. 
. gen more_visits_dummy = (visits > lagged_visits)

. replace more_visits_dummy = . if (visits == . | lagged_visits == .)
(1,907,647 real changes made, 1,907,647 to missing)

. gen less_visits_dummy = (visits < lagged_visits)

. replace less_visits_dummy = . if (visits == . | lagged_visits == .)
(1,907,647 real changes made, 1,907,647 to missing)

. 
. *** Take average by month to create a diffusion index
. collapse (mean) more_spend_dummy more_visits_dummy more_emp_dummy less_spend_
> dummy less_visits_dummy less_emp_dummy, by(year_month_gs)

. 
. drop if more_spend_dummy ==. | more_visits_dummy == . | more_emp_dummy == .
(12 observations deleted)

. 
. ** Create same indexes as National Restaurant Association 
. gen sg_sales_index = 10*(more_spend_dummy - less_spend_dummy) + 100

. gen sg_visits_index = 10*(more_visits_dummy - less_visits_dummy) + 100

. gen sg_emp_index = 10*(more_emp_dummy - less_emp_dummy) + 100

. 
. *************************************
. **** Merge with NRA data 
. merge 1:1 year_month_gs using `nra_data', nogen keep(1 3)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                                36  
    -----------------------------------------

. 
. *********************************
. *** Make Graphs 
. label var year_month_gs "Year-Month"

. 
. *** We want to examine the monthly differences between the indexes, and show 
> correlation 
. * create month to month differences: 
. 
. tsset year_month_gs

Time variable: year_month_gs, 2020m1 to 2022m12
        Delta: 1 month

. foreach var of varlist sales_index visits_index labor_index  {
  2.         gen diff_`var' = D.`var'
  3.         label var diff_`var' "NRA"
  4. }
(1 missing value generated)
(1 missing value generated)
(1 missing value generated)

. 
. foreach var of varlist sg_sales_index sg_visits_index sg_emp_index {
  2.         gen diff_`var' = D.`var'
  3.         label var diff_`var' "Safegraph"
  4. }
(1 missing value generated)
(1 missing value generated)
(1 missing value generated)

. 
. ****** Graph and find correlation coefficient 
. corr diff_sales_index diff_sg_sales_index
(obs=35)

             | diff_sa~ diff_s..
-------------+------------------
diff_sales~x |   1.0000
diff_sg_sa~x |   0.4656   1.0000


. local correlation = r(C)[2,1]

. local fmtcorr : display %4.3f `correlation'

. graph twoway line diff_sales_index diff_sg_sales_index year_month_gs, title("
> Same-Store Sales Index, Monthly Change") ytitle(Change in Index from Previous
>  Month) subtitle("Correlation Coefficient: `fmtcorr'") ylabel(-15(5)15) legen
> d(cols(2) position(6))

. graph export "${exhibits_root}/additional_analysis/1_1_nra_sales_diff.pdf", r
> eplace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/additio
    > nal_analysis/1_1_nra_sales_diff.pdf saved as PDF format

. 
. corr diff_visits_index diff_sg_visits_index
(obs=35)

             | diff_v~x diff_s..
-------------+------------------
diff_visit~x |   1.0000
diff_sg_vi~x |   0.7816   1.0000


. local correlation = r(C)[2,1]

. local fmtcorr : display %4.3f `correlation'

. graph twoway line diff_visits_index diff_sg_visits_index year_month_gs, title
> ("Same-Store Customer Traffic Index, Monthly Change") ytitle(Change in Index 
> from Previous Month) subtitle("Correlation Coefficient: `fmtcorr'") ylabel(-1
> 5(5)15) legend(cols(2) position(6))

. graph export "${exhibits_root}/additional_analysis/1_2_nra_visits_diff.pdf", 
> replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/additio
    > nal_analysis/1_2_nra_visits_diff.pdf saved as PDF format

. 
. corr diff_labor_index diff_sg_emp_index
(obs=35)

             | diff_l~x d~emp_~x
-------------+------------------
diff_labor~x |   1.0000
diff_sg_em~x |   0.6893   1.0000


. local correlation = r(C)[2,1]

. local fmtcorr : display %4.3f `correlation'

. graph twoway line diff_labor_index diff_sg_emp_index year_month_gs, title("Sa
> me-Store Labor Index, Monthly Change") ytitle(Change in Index from Previous M
> onth) subtitle("Correlation Coefficient: `fmtcorr'") ylabel(-15(5)15) legend(
> cols(2) position(6))

. graph export "${exhibits_root}/additional_analysis/1_3_nra_emp_diff.pdf", rep
> lace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/additio
    > nal_analysis/1_3_nra_emp_diff.pdf saved as PDF format

. 
. ********************************************
. ***** 2. Homebase Analysis 
. ********************************************
. *** Homebase is a employee scheduling program, we use their data to see the a
> verage length of restaurant employee shifts. 
. *** I am going to use their data going from Jan 2018 - Dec 2022.
. 
. ** Get data from Homebase Limited service eating places
. use "${built_root}/homebase_build.dta", clear

. 
. *** label things
. gen agg_hours_share = less_4_hours/agg_hours

. label var agg_hours_share "Share of Agg Hours from Shifts Less than 4 Hours"

. label var hours_worked "Avg Shift Length"

. label var agg_hours "Aggregate Hours"

. label var shift_less_4 "Share of Shifts less than 4 hours"

. label var year_month_gs "Year-Month"

. 
. replace agg_hours = agg_hours/1000000 // put into millions
(60 real changes made)

. 
. graph twoway line hours_worked year_month_gs, title("1. Avg Shift Length") su
> btitle("Limited-Service") ytitle("Avg Shift Length") ylabel(0(2)8) xlabel(696
> (12)758)

. graph export "${exhibits_root}/additional_analysis/2_1_homebase.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/additio
    > nal_analysis/2_1_homebase.pdf saved as PDF format

. 
. graph twoway line shift_less_4 year_month_gs, title("2. Share of Shifts Less 
> than 4 Hours") subtitle("Limited-Service") ytitle("Share of Shifts less than 
> 4 Hours") ylabel(0(0.05)0.2) xlabel(696(12)758)

. graph export "${exhibits_root}/additional_analysis/2_2_homebase.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/additio
    > nal_analysis/2_2_homebase.pdf saved as PDF format

. 
. graph twoway line agg_hours_share year_month_gs , title("3. Share of Agg hour
> s from <4 hr shifts") subtitle("Limited-Service") ytitle("Share of Agg hours 
> from <4 hr shifts") ylabel(0(0.01)0.06) xlabel(696(12)758)

. graph export "${exhibits_root}/additional_analysis/2_3_homebase.pdf", replace
file
    /project/fagoolsb/service_industries/replication_package/exhibits/additio
    > nal_analysis/2_3_homebase.pdf saved as PDF format

. 
. ***********************
. *** 3. Checking Correlations
. ***********************
. **** Check Year-over-year growth rate correlation of Figure A1, industry vs l
> imited service real sales per employee 
. use "${built_root}/aggregates_build.dta", clear 

. tsset year_month_gs

Time variable: year_month_gs, 1992m1 to 2024m12
        Delta: 1 month

. 
. sort year_month_gs

. foreach var of varlist prod_food_nsa prod_limited_food_cpi  {
  2.         gen `var'_y_g = 100*(`var' -l12.`var')/l12.`var'
  3. }
(14 missing values generated)
(14 missing values generated)

. *** Industry Productivity and Limited Service Productivity, Not Seasonally Ad
> justed
. corr prod_food_nsa_y_g prod_limited_food_cpi_y_g
(obs=382)

             | prod_f~g prod_l~g
-------------+------------------
prod_food_~g |   1.0000
prod_limit~g |   0.8260   1.0000


. 
. ****** Correlations of Monthly Growth Rates of comparisons of SafeGraph Aggre
> gates and BLS/Census Aggregates
. sort year_month_gs

. foreach var of varlist spend_sg visits_sg emp_sg emp_limited spend_limited {
  2.         gen `var'_g = 100*(`var' -l.`var')/l.`var'
  3. }
(349 missing values generated)
(349 missing values generated)
(349 missing values generated)
(3 missing values generated)
(73 missing values generated)

. 
. ********* Monthly growth rates correlations 
. ** SG Visits and Census Sales
. corr visits_sg_g spend_limited_g 
(obs=47)

             | visit~_g spen~d_g
-------------+------------------
 visits_sg_g |   1.0000
spend_limi~g |   0.8784   1.0000


. * SG Sales and Census Sales
. corr spend_sg_g spend_limited_g
(obs=47)

             | spen~g_g spen~d_g
-------------+------------------
  spend_sg_g |   1.0000
spend_limi~g |   0.7225   1.0000


. * SG Emp and BLS Emp
. corr emp_sg_g emp_limited_g
(obs=47)

             | emp_sg_g emp_li~g
-------------+------------------
    emp_sg_g |   1.0000
emp_limite~g |   0.6317   1.0000


. 
. ******************************
. **** Entry and Exit
. ******************************
. ** Compare SG Sample Entry and Exit to Census Business Dynamic Statistics (BD
> S) annual rates
. import delimited "${raw_root}/business_dynamic_statistics/bds2022_vcn4.csv", 
> clear
(encoding automatically selected: ISO-8859-1)
(26 vars, 12,960 obs)

. keep if vcnaics4 == 7225
(12,915 observations deleted)

. keep if year >= 2018
(40 observations deleted)

. keep year vcnaics4 estabs estabs_entry estabs_entry_rate estabs_exit estabs_e
> xit_rate

. destring year vcnaics4 estabs estabs_entry estabs_entry_rate estabs_exit esta
> bs_exit_rate, replace
year already numeric; no replace
vcnaics4 already numeric; no replace
estabs already numeric; no replace
estabs_entry: all characters numeric; replaced as long
estabs_entry_rate: all characters numeric; replaced as double
estabs_exit: all characters numeric; replaced as long
estabs_exit_rate: all characters numeric; replaced as double

. 
. tempfile entry_exit

. save `entry_exit', replace 
(file /scratch/jtatarka/14755312/St926396.000002 not found)
file /scratch/jtatarka/14755312/St926396.000002 saved as .dta format

. 
. ****** Load in SG Data 
. use placekey year_month_gs using "${built_root}/main_build.dta", clear 

. gen year = 1960 + floor(year_month_gs/12)

. bys placekey year: drop if _n != 1
(5,154,123 observations deleted)

. gen num_poi = 1

. 
. fillin placekey year

. sort placekey year

. bys placekey: gen exit = 1 if num_poi[_n] == . & num_poi[_n-1] != .
(610,977 missing values generated)

. bys placekey: gen entry = 1 if num_poi[_n] != . & num_poi[_n-1] == .
(460,367 missing values generated)

. 
. collapse (sum) num_poi entry exit, by(year) 

. 
. ** create entry and exit rates rates following how BDS does it
. tsset year

Time variable: year, 2019 to 2022
        Delta: 1 unit

. gen sg_exit_rate = 100*exit/((num_poi + l.num_poi)/2)
(1 missing value generated)

. gen sg_entry_rate = 100*entry/((num_poi + l.num_poi)/2)
(1 missing value generated)

. 
. ** merge with BDS entry and exit
. merge 1:1 year using `entry_exit', nogen 

    Result                      Number of obs
    -----------------------------------------
    Not matched                             1
        from master                         0  
        from using                          1  

    Matched                                 4  
    -----------------------------------------

. 
. sort year

. keep year sg_entry_rate sg_exit_rate estabs_entry_rate estabs_exit_rate

. drop if year == 2018
(1 observation deleted)

. 
. * Look at average of rates for 2020-2022
. sum sg_entry_rate estabs_entry_rate sg_exit_rate estabs_exit_rate if year >= 
> 2020

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
sg_entry_r~e |          3    6.073953    2.575866   4.293992   9.027641
estabs_ent~e |          3    10.33033    .9930425      9.757     11.477
sg_exit_rate |          3    2.030456    .5215016   1.573708   2.598682
estabs_exi~e |          3    9.358333    1.005883      8.329     10.339

. 
. 
. **************************
. **** Employees per Establishment - Census County Business Patterns 
. 
. ** 2019
. import delimited "${raw_root}/county_business_patterns/cbp19co.txt", clear
(encoding automatically selected: UTF-8)
(25 vars, 1,085,472 obs)

. 
. keep if substr(naics,1,4) == "7225"
(1,071,877 observations deleted)

. collapse (sum) emp est, by(naics)

. gen emp_per_est = emp/est

. sum emp_per_est if naics == "7225//"

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 emp_per_est |          1    19.01272           .   19.01272   19.01272

. 
. ** 2022 
. import delimited "${raw_root}/county_business_patterns/cbp22co.txt", clear
(encoding automatically selected: UTF-8)
(23 vars, 1,100,804 obs)

. 
. keep if substr(naics,1,4) == "7225"
(1,086,950 observations deleted)

. collapse (sum) emp est, by(naics)

. gen emp_per_est = emp/est

. sum emp_per_est if naics == "7225//"

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 emp_per_est |          1    17.91832           .   17.91832   17.91832

. 
. ** 2023 data will be released in summer of 2025
. 
. 
end of do-file

. 
. 
end of do-file


. 